| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dd2e38d commit ca6f0f9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3882,11 +3882,7 @@ _PyImport_LoadLazyImportTstate(PyThreadState *tstate, PyObject *lazy_import) | |||
| 3882 | 3882 | assert(lazy_import != NULL); | |
| 3883 | 3883 | assert(PyLazyImport_CheckExact(lazy_import)); | |
| 3884 | 3884 | ||
| 3885 | - // Keep a strong reference to the lazy import object. During | ||
| 3886 | - // _PyImport_AcquireLock() below the GIL may be released, allowing | ||
| 3887 | - // another thread to resolve this same lazy import and drop all | ||
| 3888 | - // external references (from the globals dict and stack). The extra | ||
| 3889 | - // INCREF ensures the object stays alive while we work with it. | ||
| 3885 | + // lazy_import may be a borrowed ref. Keep it alive while we acquire the import lock. | ||
| 3890 | 3886 | Py_INCREF(lazy_import); | |
| 3891 | 3887 | ||
| 3892 | 3888 | PyLazyImportObject *lz = (PyLazyImportObject *)lazy_import; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments