Skip to content

Commit 18a3404

Browse files
committed
MNT: apply code review comments
1 parent 2e82f75 commit 18a3404

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

numpy/_core/src/multiarray/arraytypes.c.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ static int
276276
PyArray_Descr *descr = PyArray_DescrFromType(NPY_@TYPE@);
277277
int promotion_state = get_npy_promotion_state();
278278
if (promotion_state == NPY_USE_LEGACY_PROMOTION || (
279-
get_npy_promotion_state() == NPY_USE_WEAK_PROMOTION_AND_WARN
280-
&& !npy_give_promotion_warnings())) {
279+
promotion_state == NPY_USE_WEAK_PROMOTION_AND_WARN
280+
&& !npy_give_promotion_warnings())) {
281281
/*
282282
* This path will be taken both for the "promotion" case such as
283283
* `uint8_arr + 123` as well as the assignment case.

numpy/_core/src/multiarray/convert_datatype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ NPY_NO_EXPORT PyObject *NO_NEP50_WARNING_CTX = NULL;
5656
NPY_NO_EXPORT PyObject *npy_DTypePromotionError = NULL;
5757
NPY_NO_EXPORT PyObject *npy_UFuncNoLoopError = NULL;
5858

59-
NPY_NO_EXPORT NPY_TLS int npy_promotion_state = NPY_USE_LEGACY_PROMOTION;
59+
static NPY_TLS int npy_promotion_state = NPY_USE_LEGACY_PROMOTION;
6060

6161
NPY_NO_EXPORT int
6262
get_npy_promotion_state() {

numpy/_core/src/multiarray/convert_datatype.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ extern NPY_NO_EXPORT npy_intp REQUIRED_STR_LEN[];
1313
#define NPY_USE_WEAK_PROMOTION 1
1414
#define NPY_USE_WEAK_PROMOTION_AND_WARN 2
1515

16-
extern NPY_NO_EXPORT NPY_TLS int npy_promotion_state;
1716
extern NPY_NO_EXPORT PyObject *NO_NEP50_WARNING_CTX;
1817
extern NPY_NO_EXPORT PyObject *npy_DTypePromotionError;
1918
extern NPY_NO_EXPORT PyObject *npy_UFuncNoLoopError;

0 commit comments

Comments
 (0)