summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0916
blob: d98b82d298c94bb29369ffc0e145f902da01752a (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0916
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0916
Problem:    With Python 3.7 "find_module" is not made available.
Solution:   Also add "find_module" with Python 3.7. (Joel Frederico,
            closes #3954)
Files:	    src/if_py_both.h


*** ../vim-8.1.0915/src/if_py_both.h	2019-01-26 17:28:22.224599141 +0100
--- src/if_py_both.h	2019-02-14 13:25:06.212496505 +0100
***************
*** 87,95 ****
  #if PY_VERSION_HEX >= 0x030700f0
  static PyObject *py_find_spec;
  #else
- static PyObject *py_find_module;
  static PyObject *py_load_module;
  #endif
  
  static PyObject *VimError;
  
--- 87,95 ----
  #if PY_VERSION_HEX >= 0x030700f0
  static PyObject *py_find_spec;
  #else
  static PyObject *py_load_module;
  #endif
+ static PyObject *py_find_module;
  
  static PyObject *VimError;
  
***************
*** 759,765 ****
  	sprintf(buf, "%ld", (long)our_tv->vval.v_number);
  	ret = PyString_FromString((char *)buf);
      }
! # ifdef FEAT_FLOAT
      else if (our_tv->v_type == VAR_FLOAT)
      {
  	char buf[NUMBUFLEN];
--- 759,765 ----
  	sprintf(buf, "%ld", (long)our_tv->vval.v_number);
  	ret = PyString_FromString((char *)buf);
      }
! #ifdef FEAT_FLOAT
      else if (our_tv->v_type == VAR_FLOAT)
      {
  	char buf[NUMBUFLEN];
***************
*** 767,773 ****
  	sprintf(buf, "%f", our_tv->vval.v_float);
  	ret = PyString_FromString((char *)buf);
      }
! # endif
      else if (our_tv->v_type == VAR_LIST)
      {
  	list_T		*list = our_tv->vval.v_list;
--- 767,773 ----
  	sprintf(buf, "%f", our_tv->vval.v_float);
  	ret = PyString_FromString((char *)buf);
      }
! #endif
      else if (our_tv->v_type == VAR_LIST)
      {
  	list_T		*list = our_tv->vval.v_list;
***************
*** 6093,6110 ****
  
      sprintf(hexBuf, "%p", (void *)obj);
  
! # ifdef PY_USE_CAPSULE
      capsule = PyDict_GetItemString(lookup_dict, hexBuf);
! # else
      capsule = (PyObject *)PyDict_GetItemString(lookup_dict, hexBuf);
! # endif
      if (capsule == NULL)
      {
! # ifdef PY_USE_CAPSULE
  	capsule = PyCapsule_New(tv, NULL, NULL);
! # else
  	capsule = PyCObject_FromVoidPtr(tv, NULL);
! # endif
  	if (PyDict_SetItemString(lookup_dict, hexBuf, capsule))
  	{
  	    Py_DECREF(capsule);
--- 6093,6110 ----
  
      sprintf(hexBuf, "%p", (void *)obj);
  
! #ifdef PY_USE_CAPSULE
      capsule = PyDict_GetItemString(lookup_dict, hexBuf);
! #else
      capsule = (PyObject *)PyDict_GetItemString(lookup_dict, hexBuf);
! #endif
      if (capsule == NULL)
      {
! #ifdef PY_USE_CAPSULE
  	capsule = PyCapsule_New(tv, NULL, NULL);
! #else
  	capsule = PyCObject_FromVoidPtr(tv, NULL);
! #endif
  	if (PyDict_SetItemString(lookup_dict, hexBuf, capsule))
  	{
  	    Py_DECREF(capsule);
***************
*** 6130,6140 ****
      {
  	typval_T	*v;
  
! # ifdef PY_USE_CAPSULE
  	v = PyCapsule_GetPointer(capsule, NULL);
! # else
  	v = PyCObject_AsVoidPtr(capsule);
! # endif
  	copy_tv(v, tv);
      }
      return 0;
--- 6130,6140 ----
      {
  	typval_T	*v;
  
! #ifdef PY_USE_CAPSULE
  	v = PyCapsule_GetPointer(capsule, NULL);
! #else
  	v = PyCObject_AsVoidPtr(capsule);
! #endif
  	copy_tv(v, tv);
      }
      return 0;
***************
*** 6921,6926 ****
--- 6921,6933 ----
  	return -1;
      }
  
+     if ((py_find_module = PyObject_GetAttrString(cls, "find_module")))
+     {
+ 	// find_module() is deprecated, this may stop working in some later
+ 	// version.
+         ADD_OBJECT(m, "_find_module", py_find_module);
+     }
+ 
      Py_DECREF(imp);
  
      ADD_OBJECT(m, "_find_spec", py_find_spec);
*** ../vim-8.1.0915/src/version.c	2019-02-14 12:56:31.686115921 +0100
--- src/version.c	2019-02-14 13:28:20.831490442 +0100
***************
*** 785,786 ****
--- 785,788 ----
  {   /* Add new patch number below this line */
+ /**/
+     916,
  /**/

-- 
CART DRIVER: Bring out your dead!
   There are legs stick out of windows and doors.  Two MEN are fighting in the
   mud - covered from head to foot in it.  Another MAN is on his hands in
   knees shovelling mud into his mouth.  We just catch sight of a MAN falling
   into a well.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///