Ensure *_like functions work with scalar shapes
@@ -31,6 +31,8 @@ def _new_like_order_and_strides(a, dtype, order, shape=None):
order = order.upper()
if order not in ['C', 'F', 'K', 'A']:
raise TypeError('order not understood: {}'.format(order))
+ if numpy.isscalar(shape):
+ shape = (shape,)
# Fallback to c_contiguous if keep order and number of dimensions
# of new shape mismatch
