@@ -28,7 +28,8 @@ enum PythonVersion {
28
28
PythonVersion_32 = 0x0302 ,
29
29
PythonVersion_33 = 0x0303 ,
30
30
PythonVersion_34 = 0x0304 ,
31
- PythonVersion_35 = 0x0305
31
+ PythonVersion_35 = 0x0305 ,
32
+ PythonVersion_36 = 0x0306
32
33
};
33
34
34
35
@@ -144,7 +145,38 @@ class PyCodeObject33_35 : public PyObject {
144
145
}
145
146
};
146
147
147
- // 2.5 - 3.1
148
+ // 3.6
149
+ class PyCodeObject36 : public PyObject {
150
+ public:
151
+ int co_argcount; /* #arguments, except *args */
152
+ int co_kwonlyargcount; /* #keyword only arguments */
153
+ int co_nlocals; /* #local variables */
154
+ int co_stacksize; /* #entries needed for evaluation stack */
155
+ int co_flags; /* CO_..., see below */
156
+ int co_firstlineno; /* first source line number */
157
+ PyObject *co_code; /* instruction opcodes */
158
+ PyObject *co_consts; /* list (constants used) */
159
+ PyObject *co_names; /* list of strings (names used) */
160
+ PyObject *co_varnames; /* tuple of strings (local variable names) */
161
+ PyObject *co_freevars; /* tuple of strings (free variable names) */
162
+ PyObject *co_cellvars; /* tuple of strings (cell variable names) */
163
+ /* The rest doesn't count for hash or comparisons */
164
+ unsigned char *co_cell2arg; /* Maps cell vars which are arguments. */
165
+ PyObject *co_filename; /* unicode (where it was loaded from) */
166
+ PyObject *co_name; /* unicode (name, for reference) */
167
+ PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) */
168
+ void *co_zombieframe; /* for optimization only (see frameobject.c) */
169
+
170
+ static bool IsFor (int majorVersion, int minorVersion) {
171
+ return majorVersion == 3 && minorVersion >= 6 ;
172
+ }
173
+
174
+ static bool IsFor (PythonVersion version) {
175
+ return version >= PythonVersion_36;
176
+ }
177
+ };
178
+
179
+ // 2.5 - 3.6
148
180
class PyFunctionObject : public PyObject {
149
181
public:
150
182
PyObject *func_code; /* A code object */
@@ -175,7 +207,7 @@ typedef struct {
175
207
long hash; /* Hash value; -1 if not set */
176
208
} PyUnicodeObject;
177
209
178
- // 2.4 - 3.5 compatible
210
+ // 2.4 - 3.6 compatible
179
211
class PyFrameObject : public PyVarObject {
180
212
public:
181
213
PyFrameObject *f_back; /* previous frame, or NULL */
@@ -216,7 +248,7 @@ class PyFrameObject25_33 : public PyFrameObject {
216
248
}
217
249
};
218
250
219
- class PyFrameObject34_35 : public PyFrameObject {
251
+ class PyFrameObject34_36 : public PyFrameObject {
220
252
public:
221
253
/* Borrowed reference to a generator, or NULL */
222
254
PyObject *f_gen;
@@ -231,14 +263,14 @@ class PyFrameObject34_35 : public PyFrameObject {
231
263
PyObject *f_localsplus[1 ]; /* locals+stack, dynamically sized */
232
264
233
265
static bool IsFor (int majorVersion, int minorVersion) {
234
- return majorVersion == 3 && minorVersion >= 4 && minorVersion <= 5 ;
266
+ return majorVersion == 3 && minorVersion >= 4 && minorVersion <= 6 ;
235
267
}
236
268
};
237
269
238
270
239
271
typedef void (*destructor)(PyObject *);
240
272
241
- // 2.4 - 3.5
273
+ // 2.4 - 3.6
242
274
class PyMethodDef {
243
275
public:
244
276
char *ml_name; /* The name of the built-in function/method */
@@ -261,7 +293,7 @@ class PyTypeObject : public PyVarObject {
261
293
void * tp_setattr;
262
294
union {
263
295
void * tp_compare; /* 2.4 - 3.4 */
264
- void * tp_as_async; /* 3.5 */
296
+ void * tp_as_async; /* 3.5 - 3.6 */
265
297
};
266
298
void * tp_repr;
267
299
@@ -331,7 +363,7 @@ class PyTypeObject : public PyVarObject {
331
363
unsigned int tp_version_tag;
332
364
};
333
365
334
- // 2.4 - 3.5
366
+ // 2.4 - 3.6
335
367
class PyTupleObject : public PyVarObject {
336
368
public:
337
369
PyObject *ob_item[1 ];
@@ -342,7 +374,7 @@ class PyTupleObject : public PyVarObject {
342
374
*/
343
375
};
344
376
345
- // 2.4 - 3.5
377
+ // 2.4 - 3.6
346
378
class PyCFunctionObject : public PyObject {
347
379
public:
348
380
PyMethodDef *m_ml; /* Description of the C function to call */
@@ -473,7 +505,7 @@ class PyThreadState_30_33 : public PyThreadState {
473
505
}
474
506
};
475
507
476
- class PyThreadState_34_35 : public PyThreadState {
508
+ class PyThreadState_34_36 : public PyThreadState {
477
509
public:
478
510
PyThreadState *prev;
479
511
PyThreadState *next;
@@ -513,11 +545,11 @@ class PyThreadState_34_35 : public PyThreadState {
513
545
514
546
/* XXX signal handlers should also be here */
515
547
static bool IsFor (int majorVersion, int minorVersion) {
516
- return majorVersion == 3 && minorVersion >= 4 && minorVersion <= 5 ;
548
+ return majorVersion == 3 && minorVersion >= 4 && minorVersion <= 6 ;
517
549
}
518
550
519
551
static bool IsFor (PythonVersion version) {
520
- return version >= PythonVersion_34 && version <= PythonVersion_35 ;
552
+ return version >= PythonVersion_34 && version <= PythonVersion_36 ;
521
553
}
522
554
};
523
555
@@ -570,6 +602,7 @@ static PythonVersion GetPythonVersion(HMODULE hMod) {
570
602
case ' 3' : return PythonVersion_33;
571
603
case ' 4' : return PythonVersion_34;
572
604
case ' 5' : return PythonVersion_35;
605
+ case ' 6' : return PythonVersion_36;
573
606
}
574
607
}
575
608
}
0 commit comments