diff options
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 34705efc7..c2fc8da16 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1984,7 +1984,8 @@ def load(file): "np.core.numeric.load is deprecated, use pickle.load instead", DeprecationWarning, stacklevel=2) if isinstance(file, type("")): - file = open(file, "rb") + with open(file, "rb") as file_pointer: + return pickle.load(file_pointer) return pickle.load(file) |