summaryrefslogtreecommitdiff
blob: 2f50954ca856fab5732c7d9317a15f903e80c096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
43
44
45
46
47
48
49
http://code.google.com/p/modwsgi/source/detail?r=637ee0510a49f5bf80fe49b2ee27158cf01855c6

--- mod_wsgi.c
+++ mod_wsgi.c
@@ -1,7 +1,7 @@
 /* vim: set sw=4 expandtab : */
 
 /*
- * Copyright 2007-2010 GRAHAM DUMPLETON
+ * Copyright 2007-2011 GRAHAM DUMPLETON
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -3598,7 +3598,11 @@
      */
 
     if (!wsgi_daemon_pool && self->config->pass_apache_request) {
+#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 2
+        object = PyCapsule_New(self->r, 0, 0);
+#else
         object = PyCObject_FromVoidPtr(self->r, 0);
+#endif
         PyDict_SetItemString(vars, "apache.request_rec", object);
         Py_DECREF(object);
     }
@@ -8369,7 +8373,11 @@
      */
 
     if (!wsgi_daemon_pool && self->config->pass_apache_request) {
+#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 2
+        object = PyCapsule_New(self->r, 0, 0);
+#else
         object = PyCObject_FromVoidPtr(self->r, 0);
+#endif
         PyDict_SetItemString(vars, "apache.request_rec", object);
         Py_DECREF(object);
     }
@@ -13372,7 +13380,11 @@
      */
 
     if (!wsgi_daemon_pool && self->config->pass_apache_request) {
+#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 2
+        object = PyCapsule_New(self->r, 0, 0);
+#else
         object = PyCObject_FromVoidPtr(self->r, 0);
+#endif
         PyDict_SetItemString(vars, "apache.request_rec", object);
         Py_DECREF(object);
     }