changeset 150:3cbf7dca26e8

FIX: Build for PyPy v7.3.1+: "async" is a keyword in Python now: use getattr() instead of direct "lib.uwsgi.async" access
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 03 Oct 2022 14:28:58 +0200
parents 8fb0be047961
children 53a1506e60b8
files uwsginl-plugin-lang-pypy3/files/extra/patch-plugins_pypy_pypy__setup.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/uwsginl-plugin-lang-pypy3/files/extra/patch-plugins_pypy_pypy__setup.py	Mon Sep 26 23:26:30 2022 +0200
+++ b/uwsginl-plugin-lang-pypy3/files/extra/patch-plugins_pypy_pypy__setup.py	Mon Oct 03 14:28:58 2022 +0200
@@ -131,7 +131,7 @@
 +        if lib.uwsgi_worker_is_busy(mywid):
 +            return
 +        # managing atexit in async mode is a real pain...skip it for now
-+        if lib.uwsgi.async > 0:
++        if getattr(lib.uwsgi, "async") > 0:
 +            return
 +
 +    import uwsgi
@@ -216,3 +216,12 @@
      return uwsgi_pypy_rpc(node, func, *args)
  uwsgi.call = uwsgi_pypy_call
  
+@@ -1067,7 +1123,7 @@ def uwsgi_pypy_continulet_switch(wsgi_req):
+ 
+ 
+ def uwsgi_pypy_setup_continulets():
+-    if lib.uwsgi.async < 1:
++    if getattr(lib.uwsgi, "async") < 1:
+         raise Exception("pypy continulets require async mode !!!")
+     lib.uwsgi.schedule_to_main = uwsgi_pypy_continulet_switch
+     lib.uwsgi.schedule_to_req = uwsgi_pypy_continulet_schedule