Skip to content

Commit 07e8dd3

Browse files
author
Steve Chaplin
committed
SC 24/11/2004
svn path=/trunk/matplotlib/; revision=710
1 parent dad281b commit 07e8dd3

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lib/matplotlib/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,3 +817,15 @@ def tk_window_focus():
817817

818818
# True if we are running under Py2EXE (or similar)
819819
FROZEN = hasattr(sys, 'frozen')
820+
821+
822+
class MPLError (Exception):
823+
"""Exception for Matplotlib errors
824+
Attributes:
825+
message -- explanation of the error
826+
"""
827+
def __init__ (self, message):
828+
self.message = message
829+
830+
def __str__ (self):
831+
return self.message

lib/matplotlib/backends/backend_svg.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,7 @@ def print_figure(self, filename, dpi=80,
358358
self.figure.set_facecolor(origfacecolor)
359359
self.figure.set_edgecolor(origedgecolor)
360360

361-
try:
362-
fh = file(filename, 'w')
363-
except IOError:
364-
verbose.report_error('Backend SVG failed to save %s' % filename)
365-
raise
361+
fh = file(filename, 'w')
366362

367363
print >>fh, renderer.get_svg()
368364

0 commit comments

Comments
 (0)