fix demo when python buffer protocol is not supported by numpy version