Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6622c8

Browse files
committed
fix build without Py_DEBUG and DNDEBUG (closes #14509)
1 parent 7fddb4b commit f6622c8

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Objects/bytesobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,9 @@ bytes_hash(PyBytesObject *a)
896896
register unsigned char *p;
897897
register long x;
898898

899+
#ifdef Py_DEBUG
899900
assert(_Py_HashSecret_Initialized);
901+
#endif
900902
if (a->ob_shash != -1)
901903
return a->ob_shash;
902904
len = Py_SIZE(a);

Objects/unicodeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7341,7 +7341,9 @@ unicode_hash(PyUnicodeObject *self)
73417341
Py_UNICODE *p;
73427342
long x;
73437343

7344+
#ifdef Py_DEBUG
73447345
assert(_Py_HashSecret_Initialized);
7346+
#endif
73457347
if (self->hash != -1)
73467348
return self->hash;
73477349
len = Py_SIZE(self);

0 commit comments

Comments
 (0)