Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit a8cb515

Browse files
committed
Rephrase !PyErr_Occurred() comment: may=>can
Issue python#29259.
1 parent 98ccba8 commit a8cb515

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

Objects/abstract.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs)
22332233
PyObject *result;
22342234

22352235
/* PyObject_Call() must not be called with an exception set,
2236-
because it may clear it (directly or indirectly) and so the
2236+
because it can clear it (directly or indirectly) and so the
22372237
caller loses its exception */
22382238
assert(!PyErr_Occurred());
22392239
assert(PyTuple_Check(args));
@@ -2309,7 +2309,7 @@ _PyObject_FastCallDict(PyObject *callable, PyObject **args, Py_ssize_t nargs,
23092309
PyObject *result = NULL;
23102310

23112311
/* _PyObject_FastCallDict() must not be called with an exception set,
2312-
because it may clear it (directly or indirectly) and so the
2312+
because it can clear it (directly or indirectly) and so the
23132313
caller loses its exception */
23142314
assert(!PyErr_Occurred());
23152315

Objects/methodobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, PyObject **arg
9595
int flags;
9696

9797
/* _PyMethodDef_RawFastCallDict() must not be called with an exception set,
98-
because it may clear it (directly or indirectly) and so the
98+
because it can clear it (directly or indirectly) and so the
9999
caller loses its exception */
100100
assert(!PyErr_Occurred());
101101

Objects/object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ PyObject_Repr(PyObject *v)
477477

478478
#ifdef Py_DEBUG
479479
/* PyObject_Repr() must not be called with an exception set,
480-
because it may clear it (directly or indirectly) and so the
480+
because it can clear it (directly or indirectly) and so the
481481
caller loses its exception */
482482
assert(!PyErr_Occurred());
483483
#endif
@@ -526,7 +526,7 @@ PyObject_Str(PyObject *v)
526526

527527
#ifdef Py_DEBUG
528528
/* PyObject_Str() must not be called with an exception set,
529-
because it may clear it (directly or indirectly) and so the
529+
because it can clear it (directly or indirectly) and so the
530530
caller loses its exception */
531531
assert(!PyErr_Occurred());
532532
#endif

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
887887

888888
#ifdef Py_DEBUG
889889
/* type_call() must not be called with an exception set,
890-
because it may clear it (directly or indirectly) and so the
890+
because it can clear it (directly or indirectly) and so the
891891
caller loses its exception */
892892
assert(!PyErr_Occurred());
893893
#endif

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
10461046

10471047
#ifdef Py_DEBUG
10481048
/* PyEval_EvalFrameEx() must not be called with an exception set,
1049-
because it may clear it (directly or indirectly) and so the
1049+
because it can clear it (directly or indirectly) and so the
10501050
caller loses its exception */
10511051
assert(!PyErr_Occurred());
10521052
#endif
@@ -3244,7 +3244,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
32443244
if (meth_found) {
32453245
/* We can bypass temporary bound method object.
32463246
meth is unbound method and obj is self.
3247-
3247+
32483248
meth | self | arg1 | ... | argN
32493249
*/
32503250
SET_TOP(meth);

0 commit comments

Comments
 (0)