Skip to content

Commit 47a29b2

Browse files
committed
Hide the warning when saving a file to a new filename in the Gtk backend. Issue #769
1 parent aa5da2e commit 47a29b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/backends/backend_gtk.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import division
22

3-
import os, sys
3+
import os, sys, warnings
44
def fn_name(): return sys._getframe(1).f_code.co_name
55

66
try:
@@ -45,6 +45,9 @@ def fn_name(): return sys._getframe(1).f_code.co_name
4545
# see http://groups.google.com/groups?q=screen+dpi+x11&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=7077.26e81ad5%40swift.cs.tcd.ie&rnum=5 for some info about screen dpi
4646
PIXELS_PER_INCH = 96
4747

48+
# Hide the benign warning that it can't stat a file that doesn't
49+
warnings.filterwarnings('ignore', '.*Unable to retrieve the file info for.*', gtk.Warning)
50+
4851
cursord = {
4952
cursors.MOVE : gdk.Cursor(gdk.FLEUR),
5053
cursors.HAND : gdk.Cursor(gdk.HAND2),

0 commit comments

Comments
 (0)