summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/source/user/c-info.ufunc-tutorial.rst21
-rw-r--r--numpy/core/include/numpy/random/distributions.h2
-rw-r--r--numpy/core/src/common/cblasfuncs.c10
-rw-r--r--numpy/core/src/common/lowlevel_strided_loops.h4
-rw-r--r--numpy/core/src/common/mem_overlap.c1
-rw-r--r--numpy/core/src/common/npy_argparse.c3
-rw-r--r--numpy/core/src/common/npy_argparse.h2
-rw-r--r--numpy/core/src/common/npy_longdouble.c1
-rw-r--r--numpy/core/src/common/python_xerbla.c4
-rw-r--r--numpy/core/src/dummymodule.c5
-rw-r--r--numpy/core/src/multiarray/_multiarray_tests.c.src2
-rw-r--r--numpy/core/src/multiarray/abstractdtypes.c2
-rw-r--r--numpy/core/src/multiarray/alloc.c2
-rw-r--r--numpy/core/src/multiarray/array_coercion.c5
-rw-r--r--numpy/core/src/multiarray/arrayobject.c2
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src4
-rw-r--r--numpy/core/src/multiarray/buffer.c2
-rw-r--r--numpy/core/src/multiarray/calculation.c2
-rw-r--r--numpy/core/src/multiarray/common.h2
-rw-r--r--numpy/core/src/multiarray/compiled_base.c7
-rw-r--r--numpy/core/src/multiarray/conversion_utils.c2
-rw-r--r--numpy/core/src/multiarray/convert.c4
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c2
-rw-r--r--numpy/core/src/multiarray/ctors.c2
-rw-r--r--numpy/core/src/multiarray/descriptor.c2
-rw-r--r--numpy/core/src/multiarray/dragon4.h4
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.c4
-rw-r--r--numpy/core/src/multiarray/dtypemeta.c2
-rw-r--r--numpy/core/src/multiarray/einsum.c.src4
-rw-r--r--numpy/core/src/multiarray/flagsobject.c2
-rw-r--r--numpy/core/src/multiarray/getset.c2
-rw-r--r--numpy/core/src/multiarray/item_selection.c2
-rw-r--r--numpy/core/src/multiarray/iterators.c2
-rw-r--r--numpy/core/src/multiarray/lowlevel_strided_loops.c.src2
-rw-r--r--numpy/core/src/multiarray/mapping.c2
-rw-r--r--numpy/core/src/multiarray/methods.c2
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c4
-rw-r--r--numpy/core/src/multiarray/nditer_impl.h4
-rw-r--r--numpy/core/src/multiarray/nditer_pywrap.c4
-rw-r--r--numpy/core/src/multiarray/number.c2
-rw-r--r--numpy/core/src/multiarray/refcount.c2
-rw-r--r--numpy/core/src/multiarray/scalarapi.c2
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src4
-rw-r--r--numpy/core/src/multiarray/sequence.c2
-rw-r--r--numpy/core/src/multiarray/shape.c2
-rw-r--r--numpy/core/src/multiarray/strfuncs.c6
-rw-r--r--numpy/core/src/multiarray/usertypes.c2
-rw-r--r--numpy/core/src/multiarray/vdot.c4
-rw-r--r--numpy/core/src/umath/_operand_flag_tests.c.src5
-rw-r--r--numpy/core/src/umath/_rational_tests.c.src14
-rw-r--r--numpy/core/src/umath/_struct_ufunc_tests.c.src8
-rw-r--r--numpy/core/src/umath/_umath_tests.c.src5
-rw-r--r--numpy/core/src/umath/_umath_tests.dispatch.c2
-rw-r--r--numpy/core/src/umath/clip.c.src5
-rw-r--r--numpy/core/src/umath/dispatching.c1
-rw-r--r--numpy/core/src/umath/extobj.c5
-rw-r--r--numpy/core/src/umath/legacy_array_method.c2
-rw-r--r--numpy/core/src/umath/loops.c.src4
-rw-r--r--numpy/core/src/umath/matmul.c.src4
-rw-r--r--numpy/core/src/umath/scalarmath.c.src3
-rw-r--r--numpy/core/src/umath/ufunc_object.c6
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.c5
-rw-r--r--numpy/core/src/umath/umathmodule.c5
-rw-r--r--numpy/f2py/cfuncs.py2
-rw-r--r--numpy/f2py/src/fortranobject.h2
-rw-r--r--numpy/f2py/src/test/foomodule.c4
-rw-r--r--numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c4
-rw-r--r--numpy/fft/_pocketfft.c7
-rw-r--r--numpy/linalg/lapack_lite/python_xerbla.c4
-rw-r--r--numpy/linalg/lapack_litemodule.c5
-rw-r--r--numpy/linalg/umath_linalg.c.src5
-rw-r--r--numpy/random/include/aligned_malloc.h2
72 files changed, 157 insertions, 113 deletions
diff --git a/doc/source/user/c-info.ufunc-tutorial.rst b/doc/source/user/c-info.ufunc-tutorial.rst
index 8ff45a934..9bd01b963 100644
--- a/doc/source/user/c-info.ufunc-tutorial.rst
+++ b/doc/source/user/c-info.ufunc-tutorial.rst
@@ -80,6 +80,7 @@ the module.
.. code-block:: c
+ #define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <math.h>
@@ -252,11 +253,12 @@ the primary thing that must be changed to create your own ufunc.
.. code-block:: c
- #include "Python.h"
- #include "math.h"
+ #define PY_SSIZE_T_CLEAN
+ #include <Python.h>
#include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_3kcompat.h"
+ #include <math.h>
/*
* single_type_logit.c
@@ -427,11 +429,12 @@ the primary thing that must be changed to create your own ufunc.
.. code-block:: c
- #include "Python.h"
- #include "math.h"
+ #define PY_SSIZE_T_CLEAN
+ #include <Python.h>
#include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h"
#include "numpy/halffloat.h"
+ #include <math.h>
/*
* multi_type_logit.c
@@ -696,11 +699,12 @@ as well as all other properties of a ufunc.
.. code-block:: c
- #include "Python.h"
- #include "math.h"
+ #define PY_SSIZE_T_CLEAN
+ #include <Python.h>
#include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h"
#include "numpy/halffloat.h"
+ #include <math.h>
/*
* multi_arg_logit.c
@@ -828,11 +832,12 @@ The C file is given below.
.. code-block:: c
- #include "Python.h"
- #include "math.h"
+ #define PY_SSIZE_T_CLEAN
+ #include <Python.h>
#include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_3kcompat.h"
+ #include <math.h>
/*
diff --git a/numpy/core/include/numpy/random/distributions.h b/numpy/core/include/numpy/random/distributions.h
index 554198174..434e052f5 100644
--- a/numpy/core/include/numpy/random/distributions.h
+++ b/numpy/core/include/numpy/random/distributions.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
-#include "Python.h"
+#include <Python.h>
#include "numpy/npy_common.h"
#include <stddef.h>
#include <stdbool.h>
diff --git a/numpy/core/src/common/cblasfuncs.c b/numpy/core/src/common/cblasfuncs.c
index e78587de0..630f0175e 100644
--- a/numpy/core/src/common/cblasfuncs.c
+++ b/numpy/core/src/common/cblasfuncs.c
@@ -3,16 +3,18 @@
* inner product and dot for numpy arrays
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
-
-#include <Python.h>
-#include <assert.h>
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
#include "npy_cblas.h"
#include "arraytypes.h"
#include "common.h"
+#include <assert.h>
+
static const double oneD[2] = {1.0, 0.0}, zeroD[2] = {0.0, 0.0};
static const float oneF[2] = {1.0, 0.0}, zeroF[2] = {0.0, 0.0};
diff --git a/numpy/core/src/common/lowlevel_strided_loops.h b/numpy/core/src/common/lowlevel_strided_loops.h
index 3df054b40..2bbe4d100 100644
--- a/numpy/core/src/common/lowlevel_strided_loops.h
+++ b/numpy/core/src/common/lowlevel_strided_loops.h
@@ -1,8 +1,8 @@
#ifndef __LOWLEVEL_STRIDED_LOOPS_H
#define __LOWLEVEL_STRIDED_LOOPS_H
#include "common.h"
-#include <npy_config.h>
-#include <array_method.h>
+#include "npy_config.h"
+#include "array_method.h"
#include "dtype_transfer.h"
#include "mem_overlap.h"
diff --git a/numpy/core/src/common/mem_overlap.c b/numpy/core/src/common/mem_overlap.c
index 9da33bfc1..0f0a75c72 100644
--- a/numpy/core/src/common/mem_overlap.c
+++ b/numpy/core/src/common/mem_overlap.c
@@ -181,6 +181,7 @@
All rights reserved.
Licensed under 3-clause BSD license, see LICENSE.txt.
*/
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/common/npy_argparse.c b/numpy/core/src/common/npy_argparse.c
index 8460a38e6..a90ff47d7 100644
--- a/numpy/core/src/common/npy_argparse.c
+++ b/numpy/core/src/common/npy_argparse.c
@@ -1,4 +1,5 @@
-#include "Python.h"
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/common/npy_argparse.h b/numpy/core/src/common/npy_argparse.h
index 5da535c91..487619d6d 100644
--- a/numpy/core/src/common/npy_argparse.h
+++ b/numpy/core/src/common/npy_argparse.h
@@ -1,7 +1,7 @@
#ifndef _NPY_ARGPARSE_H
#define _NPY_ARGPARSE_H
-#include "Python.h"
+#include <Python.h>
#include "numpy/ndarraytypes.h"
/*
diff --git a/numpy/core/src/common/npy_longdouble.c b/numpy/core/src/common/npy_longdouble.c
index 260e02a64..db9cd4a67 100644
--- a/numpy/core/src/common/npy_longdouble.c
+++ b/numpy/core/src/common/npy_longdouble.c
@@ -1,3 +1,4 @@
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/common/python_xerbla.c b/numpy/core/src/common/python_xerbla.c
index fe2f718b2..37a41408b 100644
--- a/numpy/core/src/common/python_xerbla.c
+++ b/numpy/core/src/common/python_xerbla.c
@@ -1,4 +1,6 @@
-#include "Python.h"
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "numpy/npy_common.h"
#include "npy_cblas.h"
diff --git a/numpy/core/src/dummymodule.c b/numpy/core/src/dummymodule.c
index e26875736..a58b48839 100644
--- a/numpy/core/src/dummymodule.c
+++ b/numpy/core/src/dummymodule.c
@@ -4,12 +4,13 @@
* This is a dummy module whose purpose is to get distutils to generate the
* configuration files before the libraries are made.
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define NO_IMPORT_ARRAY
-#include <Python.h>
-#include <npy_pycompat.h>
+#include "npy_pycompat.h"
static struct PyMethodDef methods[] = {
{NULL, NULL, 0, NULL}
diff --git a/numpy/core/src/multiarray/_multiarray_tests.c.src b/numpy/core/src/multiarray/_multiarray_tests.c.src
index f4764b371..e945d0771 100644
--- a/numpy/core/src/multiarray/_multiarray_tests.c.src
+++ b/numpy/core/src/multiarray/_multiarray_tests.c.src
@@ -1,8 +1,8 @@
/* -*-c-*- */
#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include <Python.h>
#define _NPY_NO_DEPRECATIONS /* for NPY_CHAR */
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/abstractdtypes.c b/numpy/core/src/multiarray/abstractdtypes.c
index 3fa354ddc..48715fbd5 100644
--- a/numpy/core/src/multiarray/abstractdtypes.c
+++ b/numpy/core/src/multiarray/abstractdtypes.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/multiarray/alloc.c b/numpy/core/src/multiarray/alloc.c
index e74056736..1afcee602 100644
--- a/numpy/core/src/multiarray/alloc.c
+++ b/numpy/core/src/multiarray/alloc.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#include <pymem.h>
diff --git a/numpy/core/src/multiarray/array_coercion.c b/numpy/core/src/multiarray/array_coercion.c
index 89719f129..172b88c72 100644
--- a/numpy/core/src/multiarray/array_coercion.c
+++ b/numpy/core/src/multiarray/array_coercion.c
@@ -1,9 +1,10 @@
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _UMATHMODULE
#define _MULTIARRAYMODULE
-#include "Python.h"
-
#include "numpy/npy_3kcompat.h"
#include "lowlevel_strided_loops.h"
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index 55ba5601b..b27f511bd 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -22,7 +22,7 @@ maintainer email: oliphant.travis@ieee.org
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index b3ea7544d..c0c087056 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -1,7 +1,7 @@
/* -*- c -*- */
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#include <limits.h>
#include <assert.h>
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c
index 5458c81cc..a3d5090b0 100644
--- a/numpy/core/src/multiarray/buffer.c
+++ b/numpy/core/src/multiarray/buffer.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c
index 21e52c32b..587c05ccc 100644
--- a/numpy/core/src/multiarray/calculation.c
+++ b/numpy/core/src/multiarray/calculation.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/common.h b/numpy/core/src/multiarray/common.h
index 203decaa0..3251da480 100644
--- a/numpy/core/src/multiarray/common.h
+++ b/numpy/core/src/multiarray/common.h
@@ -1,6 +1,6 @@
#ifndef _NPY_PRIVATE_COMMON_H_
#define _NPY_PRIVATE_COMMON_H_
-#include "structmember.h"
+#include <structmember.h>
#include <numpy/npy_common.h>
#include <numpy/ndarraytypes.h>
#include <limits.h>
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index de793f87c..186cd7b61 100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -1,7 +1,8 @@
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#include <string.h>
+
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
@@ -15,6 +16,8 @@
#include "common.h"
#include "simd/simd.h"
+#include <string.h>
+
typedef enum {
PACK_ORDER_LITTLE = 0,
PACK_ORDER_BIG
diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c
index adfff1129..81f73c892 100644
--- a/numpy/core/src/multiarray/conversion_utils.c
+++ b/numpy/core/src/multiarray/conversion_utils.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
index 29a2bb0e8..b20006785 100644
--- a/numpy/core/src/multiarray/convert.c
+++ b/numpy/core/src/multiarray/convert.c
@@ -1,8 +1,8 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
-#include <npy_config.h>
+#include "npy_config.h"
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 45b03a6f3..da52d1371 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index aaa645c16..310d19283 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index 90453e38f..7b4e28f1d 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -2,7 +2,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/dragon4.h b/numpy/core/src/multiarray/dragon4.h
index 4b76bf9e5..d1b799f68 100644
--- a/numpy/core/src/multiarray/dragon4.h
+++ b/numpy/core/src/multiarray/dragon4.h
@@ -33,8 +33,8 @@
#ifndef _NPY_DRAGON4_H_
#define _NPY_DRAGON4_H_
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
#include "numpy/arrayobject.h"
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index 50db627ea..169025a63 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -11,8 +11,8 @@
*/
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/dtypemeta.c b/numpy/core/src/multiarray/dtypemeta.c
index 597468c50..a8e845c34 100644
--- a/numpy/core/src/multiarray/dtypemeta.c
+++ b/numpy/core/src/multiarray/dtypemeta.c
@@ -2,7 +2,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#include "assert.h"
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/multiarray/einsum.c.src b/numpy/core/src/multiarray/einsum.c.src
index 85806fab3..cd1a58982 100644
--- a/numpy/core/src/multiarray/einsum.c.src
+++ b/numpy/core/src/multiarray/einsum.c.src
@@ -9,8 +9,8 @@
*/
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c
index fe73c18ee..c5dffd8a5 100644
--- a/numpy/core/src/multiarray/flagsobject.c
+++ b/numpy/core/src/multiarray/flagsobject.c
@@ -2,7 +2,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c
index de2a8c14e..0a13fc367 100644
--- a/numpy/core/src/multiarray/getset.c
+++ b/numpy/core/src/multiarray/getset.c
@@ -2,7 +2,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 2b8ea9e79..7ceb8b368 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index f724837ce..c8e790e46 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
index e533e4932..253012302 100644
--- a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
+++ b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
@@ -9,7 +9,7 @@
*/
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
+#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index 41311b03f..5f6befe17 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c
index dc23b3471..530f943fc 100644
--- a/numpy/core/src/multiarray/methods.c
+++ b/numpy/core/src/multiarray/methods.c
@@ -1,7 +1,7 @@
#define PY_SSIZE_T_CLEAN
#include <stdarg.h>
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index ea9c10543..6b8f52f77 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -15,8 +15,8 @@
/* $Id: multiarraymodule.c,v 1.36 2005/09/14 00:14:00 teoliphant Exp $ */
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _UMATHMODULE
diff --git a/numpy/core/src/multiarray/nditer_impl.h b/numpy/core/src/multiarray/nditer_impl.h
index a5a9177e5..6499e4895 100644
--- a/numpy/core/src/multiarray/nditer_impl.h
+++ b/numpy/core/src/multiarray/nditer_impl.h
@@ -11,8 +11,8 @@
#define _NPY_PRIVATE__NDITER_IMPL_H_
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c
index 8acc7f87f..efa13ae09 100644
--- a/numpy/core/src/multiarray/nditer_pywrap.c
+++ b/numpy/core/src/multiarray/nditer_pywrap.c
@@ -7,8 +7,8 @@
* See LICENSE.txt for the license.
*/
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c
index 9ed7cde47..45566c0fb 100644
--- a/numpy/core/src/multiarray/number.c
+++ b/numpy/core/src/multiarray/number.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c
index 41dd059b0..1d693369e 100644
--- a/numpy/core/src/multiarray/refcount.c
+++ b/numpy/core/src/multiarray/refcount.c
@@ -5,7 +5,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c
index 0e93cbbe9..22780c8b4 100644
--- a/numpy/core/src/multiarray/scalarapi.c
+++ b/numpy/core/src/multiarray/scalarapi.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index 40f736125..5a756fb99 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -1,7 +1,7 @@
/* -*- c -*- */
#define PY_SSIZE_T_CLEAN
-#include "Python.h"
-#include "structmember.h"
+#include <Python.h>
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#ifndef _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/sequence.c b/numpy/core/src/multiarray/sequence.c
index 1c74f1719..3cd3bf216 100644
--- a/numpy/core/src/multiarray/sequence.c
+++ b/numpy/core/src/multiarray/sequence.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c
index 02c349759..222906737 100644
--- a/numpy/core/src/multiarray/shape.c
+++ b/numpy/core/src/multiarray/shape.c
@@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
diff --git a/numpy/core/src/multiarray/strfuncs.c b/numpy/core/src/multiarray/strfuncs.c
index d9d9b7c0a..2fe1c8529 100644
--- a/numpy/core/src/multiarray/strfuncs.c
+++ b/numpy/core/src/multiarray/strfuncs.c
@@ -1,8 +1,10 @@
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
-#include <Python.h>
-#include <numpy/arrayobject.h>
+#include "numpy/arrayobject.h"
#include "npy_pycompat.h"
#include "npy_import.h"
#include "strfuncs.h"
diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c
index 5602304e9..be059cc45 100644
--- a/numpy/core/src/multiarray/usertypes.c
+++ b/numpy/core/src/multiarray/usertypes.c
@@ -22,7 +22,7 @@ maintainer email: oliphant.travis@ieee.org
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#include "structmember.h"
+#include <structmember.h>
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
diff --git a/numpy/core/src/multiarray/vdot.c b/numpy/core/src/multiarray/vdot.c
index 9b5d19522..8c4625dcb 100644
--- a/numpy/core/src/multiarray/vdot.c
+++ b/numpy/core/src/multiarray/vdot.c
@@ -1,7 +1,9 @@
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
-#include <Python.h>
#include "common.h"
#include "vdot.h"
#include "npy_cblas.h"
diff --git a/numpy/core/src/umath/_operand_flag_tests.c.src b/numpy/core/src/umath/_operand_flag_tests.c.src
index d22a5c507..c59e13baf 100644
--- a/numpy/core/src/umath/_operand_flag_tests.c.src
+++ b/numpy/core/src/umath/_operand_flag_tests.c.src
@@ -1,6 +1,7 @@
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
+
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include <numpy/arrayobject.h>
#include <numpy/ufuncobject.h>
#include "numpy/npy_3kcompat.h"
diff --git a/numpy/core/src/umath/_rational_tests.c.src b/numpy/core/src/umath/_rational_tests.c.src
index 7b1e5627a..bf50a2226 100644
--- a/numpy/core/src/umath/_rational_tests.c.src
+++ b/numpy/core/src/umath/_rational_tests.c.src
@@ -1,16 +1,16 @@
/* Fixed size rational numbers exposed to Python */
-
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>
-#include <numpy/arrayobject.h>
-#include <numpy/ufuncobject.h>
-#include <numpy/npy_3kcompat.h>
-#include <math.h>
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "numpy/npy_3kcompat.h"
#include "common.h" /* for error_converting */
+#include <math.h>
+
/* Relevant arithmetic exceptions */
diff --git a/numpy/core/src/umath/_struct_ufunc_tests.c.src b/numpy/core/src/umath/_struct_ufunc_tests.c.src
index d602656c8..ee71c4698 100644
--- a/numpy/core/src/umath/_struct_ufunc_tests.c.src
+++ b/numpy/core/src/umath/_struct_ufunc_tests.c.src
@@ -1,11 +1,13 @@
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
-#include "Python.h"
-#include "math.h"
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_3kcompat.h"
+#include <math.h>
+
/*
* struct_ufunc_test.c
diff --git a/numpy/core/src/umath/_umath_tests.c.src b/numpy/core/src/umath/_umath_tests.c.src
index 2e79d377e..0cd673831 100644
--- a/numpy/core/src/umath/_umath_tests.c.src
+++ b/numpy/core/src/umath/_umath_tests.c.src
@@ -5,9 +5,10 @@
** INCLUDES **
*****************************************************************************
*/
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
-#include "Python.h"
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_math.h"
diff --git a/numpy/core/src/umath/_umath_tests.dispatch.c b/numpy/core/src/umath/_umath_tests.dispatch.c
index 85f365010..66058550e 100644
--- a/numpy/core/src/umath/_umath_tests.dispatch.c
+++ b/numpy/core/src/umath/_umath_tests.dispatch.c
@@ -6,7 +6,9 @@
* VSX VSX2 VSX3
* NEON ASIMD ASIMDHP
*/
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
+
#include "npy_cpu_dispatch.h"
#ifndef NPY_DISABLE_OPTIMIZATION
diff --git a/numpy/core/src/umath/clip.c.src b/numpy/core/src/umath/clip.c.src
index 9c4bac2d1..bc966b7ac 100644
--- a/numpy/core/src/umath/clip.c.src
+++ b/numpy/core/src/umath/clip.c.src
@@ -1,12 +1,13 @@
/**
* This module provides the inner loops for the clip ufunc
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include "Python.h"
-
#include "numpy/halffloat.h"
#include "numpy/npy_math.h"
#include "numpy/ndarraytypes.h"
diff --git a/numpy/core/src/umath/dispatching.c b/numpy/core/src/umath/dispatching.c
index b97441b13..24faa49f3 100644
--- a/numpy/core/src/umath/dispatching.c
+++ b/numpy/core/src/umath/dispatching.c
@@ -34,6 +34,7 @@
* into the `signature` so that it is available to the ufunc loop.
*
*/
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#define _UMATHMODULE
diff --git a/numpy/core/src/umath/extobj.c b/numpy/core/src/umath/extobj.c
index cd81f7734..65dd28890 100644
--- a/numpy/core/src/umath/extobj.c
+++ b/numpy/core/src/umath/extobj.c
@@ -1,9 +1,10 @@
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include <Python.h>
-
#include "npy_config.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/umath/legacy_array_method.c b/numpy/core/src/umath/legacy_array_method.c
index 4351f1d25..ed2d2a2f6 100644
--- a/numpy/core/src/umath/legacy_array_method.c
+++ b/numpy/core/src/umath/legacy_array_method.c
@@ -2,7 +2,7 @@
* This file defines most of the machinery in order to wrap legacy style
* ufunc loops into new style arraymethods.
*/
-
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#define _UMATHMODULE
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src
index 8df439aca..7c0710819 100644
--- a/numpy/core/src/umath/loops.c.src
+++ b/numpy/core/src/umath/loops.c.src
@@ -1,11 +1,11 @@
/* -*- c -*- */
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include "Python.h"
-
#include "npy_config.h"
#include "numpy/npy_common.h"
#include "numpy/arrayobject.h"
diff --git a/numpy/core/src/umath/matmul.c.src b/numpy/core/src/umath/matmul.c.src
index 0e47d1ab5..4dd0c4759 100644
--- a/numpy/core/src/umath/matmul.c.src
+++ b/numpy/core/src/umath/matmul.c.src
@@ -1,11 +1,11 @@
/* -*- c -*- */
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include "Python.h"
-
#include "npy_config.h"
#include "numpy/npy_common.h"
#include "numpy/arrayobject.h"
diff --git a/numpy/core/src/umath/scalarmath.c.src b/numpy/core/src/umath/scalarmath.c.src
index 5836545f8..402e6b561 100644
--- a/numpy/core/src/umath/scalarmath.c.src
+++ b/numpy/core/src/umath/scalarmath.c.src
@@ -5,12 +5,13 @@
but still supports error-modes.
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include "Python.h"
#include "npy_config.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index ebc6bf02a..081d7437a 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -23,12 +23,14 @@
* Rick White
*
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include "Python.h"
-#include "stddef.h"
+#include <stddef.h>
#include "npy_config.h"
#include "npy_pycompat.h"
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index a7d536656..ef4486523 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -20,6 +20,9 @@
*
* See LICENSE.txt for the license.
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
@@ -31,8 +34,6 @@
#include <stdbool.h>
-#include "Python.h"
-
#include "npy_config.h"
#include "npy_pycompat.h"
#include "npy_import.h"
diff --git a/numpy/core/src/umath/umathmodule.c b/numpy/core/src/umath/umathmodule.c
index 6a718889b..7ba5b5d6d 100644
--- a/numpy/core/src/umath/umathmodule.c
+++ b/numpy/core/src/umath/umathmodule.c
@@ -15,12 +15,13 @@
* This is a mess and it would be nice to fix it. It has nothing to do with
* __ufunc_api.c
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#define _UMATHMODULE
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#include "Python.h"
-
#include "npy_config.h"
#include "numpy/arrayobject.h"
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index 714f9a932..8f42b4029 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -51,7 +51,7 @@ includes0['math.h'] = '#include <math.h>'
includes0['string.h'] = '#include <string.h>'
includes0['setjmp.h'] = '#include <setjmp.h>'
-includes['Python.h'] = '#include "Python.h"'
+includes['Python.h'] = '#include <Python.h>'
needs['arrayobject.h'] = ['Python.h']
includes['arrayobject.h'] = '''#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API
#include "arrayobject.h"'''
diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h
index d4cc10243..278c236a7 100644
--- a/numpy/f2py/src/fortranobject.h
+++ b/numpy/f2py/src/fortranobject.h
@@ -4,7 +4,7 @@
extern "C" {
#endif
-#include "Python.h"
+#include <Python.h>
#ifdef FORTRANOBJECT_C
#define NO_IMPORT_ARRAY
diff --git a/numpy/f2py/src/test/foomodule.c b/numpy/f2py/src/test/foomodule.c
index 88ec62440..00a48f4c0 100644
--- a/numpy/f2py/src/test/foomodule.c
+++ b/numpy/f2py/src/test/foomodule.c
@@ -9,7 +9,9 @@
extern "C" {
#endif
-#include "Python.h"
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "fortranobject.h"
static PyObject *foo_error;
diff --git a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c
index fe21d4b9b..ea47e0555 100644
--- a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c
+++ b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c
@@ -9,7 +9,9 @@ extern "C" {
#endif
/*********************** See f2py2e/cfuncs.py: includes ***********************/
-#include "Python.h"
+
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#include "fortranobject.h"
#include <math.h>
diff --git a/numpy/fft/_pocketfft.c b/numpy/fft/_pocketfft.c
index ba9995f97..5a4931c01 100644
--- a/numpy/fft/_pocketfft.c
+++ b/numpy/fft/_pocketfft.c
@@ -9,17 +9,18 @@
* Copyright (C) 2004-2018 Max-Planck-Society
* \author Martin Reinecke
*/
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-
-#include "Python.h"
#include "numpy/arrayobject.h"
+#include "npy_config.h"
+
#include <math.h>
#include <string.h>
#include <stdlib.h>
-#include "npy_config.h"
#define restrict NPY_RESTRICT
#define RALLOC(type,num) \
diff --git a/numpy/linalg/lapack_lite/python_xerbla.c b/numpy/linalg/lapack_lite/python_xerbla.c
index fe2f718b2..37a41408b 100644
--- a/numpy/linalg/lapack_lite/python_xerbla.c
+++ b/numpy/linalg/lapack_lite/python_xerbla.c
@@ -1,4 +1,6 @@
-#include "Python.h"
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
#include "numpy/npy_common.h"
#include "npy_cblas.h"
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c
index 362a593a6..00a806465 100644
--- a/numpy/linalg/lapack_litemodule.c
+++ b/numpy/linalg/lapack_litemodule.c
@@ -2,9 +2,10 @@
Modified by Jim Hugunin
More modifications by Jeff Whitaker
*/
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
-#include "Python.h"
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/arrayobject.h"
#include "npy_cblas.h"
diff --git a/numpy/linalg/umath_linalg.c.src b/numpy/linalg/umath_linalg.c.src
index a486e9e5b..ff63ea218 100644
--- a/numpy/linalg/umath_linalg.c.src
+++ b/numpy/linalg/umath_linalg.c.src
@@ -5,9 +5,10 @@
** INCLUDES **
*****************************************************************************
*/
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
-#include "Python.h"
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
diff --git a/numpy/random/include/aligned_malloc.h b/numpy/random/include/aligned_malloc.h
index ea24f6d23..43f68253d 100644
--- a/numpy/random/include/aligned_malloc.h
+++ b/numpy/random/include/aligned_malloc.h
@@ -1,7 +1,7 @@
#ifndef _RANDOMDGEN__ALIGNED_MALLOC_H_
#define _RANDOMDGEN__ALIGNED_MALLOC_H_
-#include "Python.h"
+#include <Python.h>
#include "numpy/npy_common.h"
#define NPY_MEMALIGN 16 /* 16 for SSE2, 32 for AVX, 64 for Xeon Phi */