@@ -137,7 +137,7 @@ PyThreadState *slp_initial_tstate = NULL;
137137
138138static void * slp_error_handler = NULL ;
139139
140- int
140+ int
141141slp_pickle_with_tracing_state ()
142142{
143143 PyObject * flag , * slp_module ;
@@ -315,7 +315,7 @@ PyStackless_GetCurrentId(void)
315315 PyThreadState * ts = PyThreadState_GET ();
316316#endif
317317 PyTaskletObject * t = NULL ;
318- /* if there is threadstate, and there is a main tasklet, then the
318+ /* if there is threadstate, and there is a main tasklet, then the
319319 * "current" is the actively running tasklet.
320320 * If there isn't a "main", then the tasklet in "current" is merely a
321321 * runnable one
@@ -1144,7 +1144,7 @@ build_args(char *format, va_list va)
11441144 return PyTuple_New (0 );
11451145 if (args == NULL )
11461146 return NULL ;
1147-
1147+
11481148 if (!PyTuple_Check (args )) {
11491149 PyObject * a ;
11501150 a = PyTuple_New (1 );
@@ -1674,6 +1674,9 @@ static int init_stackless_methods(void)
16741674int
16751675_PyStackless_InitTypes (void )
16761676{
1677+ /* record the thread state for thread support */
1678+ slp_initial_tstate = PyThreadState_GET ();
1679+
16771680 if (0
16781681 || init_stackless_methods ()
16791682 || PyType_Ready (& PyTasklet_Type ) /* need this early for the main tasklet */
@@ -1710,9 +1713,6 @@ PyInit__stackless(void)
17101713 )
17111714 return NULL ;
17121715
1713- /* record the thread state for thread support */
1714- slp_initial_tstate = PyThreadState_GET ();
1715-
17161716 /* Create the module and add the functions */
17171717 slp_module = PyModule_Create (& stacklessmodule );
17181718 if (slp_module == NULL )
0 commit comments