@@ -28,7 +28,8 @@ enum PythonVersion {
2828 PythonVersion_32 =0x0302 ,
2929 PythonVersion_33 =0x0303 ,
3030 PythonVersion_34 =0x0304 ,
31- PythonVersion_35 =0x0305
31+ PythonVersion_35 =0x0305 ,
32+ PythonVersion_36 =0x0306
3233};
3334
3435
@@ -144,7 +145,38 @@ class PyCodeObject33_35 : public PyObject {
144145 }
145146};
146147
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
148180class PyFunctionObject :public PyObject {
149181public:
150182 PyObject *func_code;/* A code object*/
@@ -175,7 +207,7 @@ typedef struct {
175207long hash;/* Hash value; -1 if not set*/
176208} PyUnicodeObject;
177209
178- // 2.4 - 3.5 compatible
210+ // 2.4 - 3.6 compatible
179211class PyFrameObject :public PyVarObject {
180212public:
181213 PyFrameObject *f_back;/* previous frame, or NULL*/
@@ -216,7 +248,7 @@ class PyFrameObject25_33 : public PyFrameObject {
216248 }
217249};
218250
219- class PyFrameObject34_35 :public PyFrameObject {
251+ class PyFrameObject34_36 :public PyFrameObject {
220252public:
221253/* Borrowed reference to a generator, or NULL*/
222254 PyObject *f_gen;
@@ -231,14 +263,14 @@ class PyFrameObject34_35 : public PyFrameObject {
231263 PyObject *f_localsplus[1 ];/* locals+stack, dynamically sized*/
232264
233265static bool IsFor (int majorVersion,int minorVersion) {
234- return majorVersion ==3 && minorVersion >=4 && minorVersion <=5 ;
266+ return majorVersion ==3 && minorVersion >=4 && minorVersion <=6 ;
235267 }
236268};
237269
238270
239271typedef void (*destructor)(PyObject *);
240272
241- // 2.4 - 3.5
273+ // 2.4 - 3.6
242274class PyMethodDef {
243275public:
244276char *ml_name;/* The name of the built-in function/method*/
@@ -261,7 +293,7 @@ class PyTypeObject : public PyVarObject {
261293void * tp_setattr;
262294union {
263295void * tp_compare;/* 2.4 - 3.4*/
264- void * tp_as_async;/* 3.5*/
296+ void * tp_as_async;/* 3.5- 3.6 */
265297 };
266298void * tp_repr;
267299
@@ -331,7 +363,7 @@ class PyTypeObject : public PyVarObject {
331363unsigned int tp_version_tag;
332364};
333365
334- // 2.4 - 3.5
366+ // 2.4 - 3.6
335367class PyTupleObject :public PyVarObject {
336368public:
337369 PyObject *ob_item[1 ];
@@ -342,7 +374,7 @@ class PyTupleObject : public PyVarObject {
342374*/
343375};
344376
345- // 2.4 - 3.5
377+ // 2.4 - 3.6
346378class PyCFunctionObject :public PyObject {
347379public:
348380 PyMethodDef *m_ml;/* Description of the C function to call*/
@@ -473,7 +505,7 @@ class PyThreadState_30_33 : public PyThreadState {
473505 }
474506};
475507
476- class PyThreadState_34_35 :public PyThreadState {
508+ class PyThreadState_34_36 :public PyThreadState {
477509public:
478510 PyThreadState *prev;
479511 PyThreadState *next;
@@ -513,11 +545,11 @@ class PyThreadState_34_35 : public PyThreadState {
513545
514546/* XXX signal handlers should also be here*/
515547static bool IsFor (int majorVersion,int minorVersion) {
516- return majorVersion ==3 && minorVersion >=4 && minorVersion <=5 ;
548+ return majorVersion ==3 && minorVersion >=4 && minorVersion <=6 ;
517549 }
518550
519551static bool IsFor (PythonVersion version) {
520- return version >= PythonVersion_34 && version <=PythonVersion_35 ;
552+ return version >= PythonVersion_34 && version <=PythonVersion_36 ;
521553 }
522554};
523555
@@ -570,6 +602,7 @@ static PythonVersion GetPythonVersion(HMODULE hMod) {
570602case ' 3' :return PythonVersion_33;
571603case ' 4' :return PythonVersion_34;
572604case ' 5' :return PythonVersion_35;
605+ case ' 6' :return PythonVersion_36;
573606 }
574607 }
575608 }