mirror of
https://github.com/boostorg/python.git
synced 2026-01-21 05:02:17 +00:00
Avoid Python 3 compile warnings in NumPy initialization
This commit is contained in:
@@ -12,9 +12,19 @@ namespace boost
|
||||
namespace numpy
|
||||
{
|
||||
|
||||
#if PY_MAJOR_VERSION == 2
|
||||
static void wrap_import_array() {
|
||||
import_array();
|
||||
}
|
||||
#else
|
||||
static void * wrap_import_array() {
|
||||
import_array();
|
||||
}
|
||||
#endif
|
||||
|
||||
void initialize(bool register_scalar_converters)
|
||||
{
|
||||
import_array();
|
||||
wrap_import_array();
|
||||
import_ufunc();
|
||||
if (register_scalar_converters)
|
||||
dtype::register_scalar_converters();
|
||||
|
||||
Reference in New Issue
Block a user