diff --git a/Framework/PythonInterface/mantid/kernel/src/Converters/PyObjectToMatrix.cpp b/Framework/PythonInterface/mantid/kernel/src/Converters/PyObjectToMatrix.cpp
index 7a0342df8a257080223dd80feafae71f800cda8b..41e05f5b076d6bb44ea4302ec61cac2f4bd2522a 100644
--- a/Framework/PythonInterface/mantid/kernel/src/Converters/PyObjectToMatrix.cpp
+++ b/Framework/PythonInterface/mantid/kernel/src/Converters/PyObjectToMatrix.cpp
@@ -63,7 +63,7 @@ Kernel::Matrix<double> PyObjectToMatrix::operator()() {
   PyArrayObject *ndarray = (PyArrayObject *)PyArray_View(
       (PyArrayObject *)m_obj.ptr(), PyArray_DescrFromType(NPY_DOUBLE),
       &PyArray_Type);
-  const auto shape = PyArray_SHAPE(ndarray);
+  const auto shape = PyArray_DIMS(ndarray);
   npy_intp nx(shape[0]), ny(shape[1]);
   Kernel::Matrix<double> matrix(nx, ny);
   for (npy_intp i = 0; i < nx; i++) {