diff --git a/unit/memleak.py b/unit/memleak.py index 3b56f996de6c..a57deaf41aed 100755 --- a/unit/memleak.py +++ b/unit/memleak.py @@ -3,6 +3,7 @@ from __future__ import print_function import gc +from io import BytesIO try: import tracemalloc @@ -110,7 +111,7 @@ def __call__(self): ax = fig.add_subplot(224) ax.pcolor(10 * np.random.rand(50, 50)) - fig.savefig('tmp', dpi=75) + fig.savefig(BytesIO(), dpi=75) plt.close(1)