Skip to content

Commit

Permalink
add an assertion for flag-like parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz committed Oct 22, 2024
1 parent 558ce3c commit fc6c4a2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Objects/memoryobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
*/

#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_memoryobject.h" // _PyManagedBuffer_Type
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_strhex.h" // _Py_strhex_with_sep()

#include <stdbool.h> // bool
#include <stddef.h> // offsetof()
#include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_memoryobject.h" // _PyManagedBuffer_Type
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_strhex.h" // _Py_strhex_with_sep()
#include <stddef.h> // offsetof()

/*[clinic input]
class memoryview "PyMemoryViewObject *" "&PyMemoryView_Type"
Expand Down Expand Up @@ -3310,8 +3308,10 @@ typedef struct {
#define _PyMemoryViewIter_CAST(PTR) ((memoryiterobject *)(PTR))

static PyObject *
memoryiter_new(PyObject *self, bool reversed)
memoryiter_new(PyObject *self, int reversed)
{
assert(reversed == 0 || reversed == 1);

if (!PyMemoryView_Check(self)) {
PyErr_BadInternalCall();
return NULL;
Expand Down

0 comments on commit fc6c4a2

Please sign in to comment.