10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37cf914 commit eac6056Copy full SHA for eac6056
numpy/ma/core.py
@@ -7818,8 +7818,10 @@ def dump(a, F):
7818
7819
"""
7820
if not hasattr(F, 'readline'):
7821
- F = open(F, 'w')
7822
- return pickle.dump(a, F)
+ with open(F, 'w') as F:
+ pickle.dump(a, F)
7823
+ else:
7824
7825
7826
7827
def dumps(a):
@@ -7859,8 +7861,10 @@ def load(F):
7859
7861
7860
7862
7863
- F = open(F, 'r')
- return pickle.load(F)
7864
+ with open(F, 'r') as F:
7865
+ pickle.load(F)
7866
7867
7868
7869
7870
def loads(strg):
0 commit comments