@@ -565,19 +565,15 @@ pycore_init_types(void)
|
565 | 565 | return status; |
566 | 566 | } |
567 | 567 | |
| 568 | +if (!_PyLong_Init()) { |
| 569 | +return _PyStatus_ERR("can't init longs"); |
| 570 | + } |
| 571 | + |
568 | 572 | status = _PyUnicode_Init(); |
569 | 573 | if (_PyStatus_EXCEPTION(status)) { |
570 | 574 | return status; |
571 | 575 | } |
572 | 576 | |
573 | | -if (_PyStructSequence_Init() < 0) { |
574 | | -return _PyStatus_ERR("can't initialize structseq"); |
575 | | - } |
576 | | - |
577 | | -if (!_PyLong_Init()) { |
578 | | -return _PyStatus_ERR("can't init longs"); |
579 | | - } |
580 | | - |
581 | 577 | status = _PyExc_Init(); |
582 | 578 | if (_PyStatus_EXCEPTION(status)) { |
583 | 579 | return status; |
@@ -587,15 +583,19 @@ pycore_init_types(void)
|
587 | 583 | return _PyStatus_ERR("can't init float"); |
588 | 584 | } |
589 | 585 | |
590 | | -if (!_PyContext_Init()) { |
591 | | -return _PyStatus_ERR("can't init context"); |
| 586 | +if (_PyStructSequence_Init() < 0) { |
| 587 | +return _PyStatus_ERR("can't initialize structseq"); |
592 | 588 | } |
593 | 589 | |
594 | 590 | status = _PyErr_Init(); |
595 | 591 | if (_PyStatus_EXCEPTION(status)) { |
596 | 592 | return status; |
597 | 593 | } |
598 | 594 | |
| 595 | +if (!_PyContext_Init()) { |
| 596 | +return _PyStatus_ERR("can't init context"); |
| 597 | + } |
| 598 | + |
599 | 599 | return _PyStatus_OK(); |
600 | 600 | } |
601 | 601 | |
@@ -1447,16 +1447,7 @@ new_interpreter(PyThreadState **tstate_p)
|
1447 | 1447 | } |
1448 | 1448 | config = &interp->config; |
1449 | 1449 | |
1450 | | -status = _PyExc_Init(); |
1451 | | -if (_PyStatus_EXCEPTION(status)) { |
1452 | | -return status; |
1453 | | - } |
1454 | | - |
1455 | | -status = _PyErr_Init(); |
1456 | | -if (_PyStatus_EXCEPTION(status)) { |
1457 | | -return status; |
1458 | | - } |
1459 | | - |
| 1450 | +status = pycore_init_types(); |
1460 | 1451 | |
1461 | 1452 | /* XXX The following is lax in error checking */ |
1462 | 1453 | PyObject *modules = PyDict_New(); |
|