Skip to content

Commit 0eb77da

Browse files
committed
Restore comment
1 parent 55af4ba commit 0eb77da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Objects/typeobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5891,6 +5891,9 @@ _PyType_LookupStackRefAndVersion(PyTypeObject *type, PyObject *name, _PyStackRef
58915891
/* We may end up clearing live exceptions below, so make sure it's ours. */
58925892
assert(!PyErr_Occurred());
58935893

5894+
// We need to atomically do the lookup and capture the version before
5895+
// anyone else can modify our mro or mutate the type.
5896+
58945897
PyObject *res;
58955898
int error;
58965899
unsigned int assigned_version = 0; // 0 is not a valid version

0 commit comments

Comments
 (0)