summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_array_object.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/_array_api/_array_object.py')
-rw-r--r--numpy/_array_api/_array_object.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/numpy/_array_api/_array_object.py b/numpy/_array_api/_array_object.py
index 267bd698f..455e4fb63 100644
--- a/numpy/_array_api/_array_object.py
+++ b/numpy/_array_api/_array_object.py
@@ -58,9 +58,7 @@ class Array:
# Note: The spec does not have array scalars, only 0-D arrays.
if isinstance(x, np.generic):
# Convert the array scalar to a 0-D array
- xa = np.empty((), x.dtype)
- xa[()] = x
- x = xa
+ x = np.asarray(x)
if x.dtype not in _all_dtypes:
raise TypeError(f"The array_api namespace does not support the dtype '{x.dtype}'")
obj._array = x