Revision: 3909
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3909&view=rev
Author:   mdboom
Date:     2007-10-03 05:51:16 -0700 (Wed, 03 Oct 2007)

Log Message:
-----------
Merged revisions 3906-3908 via svnmerge from 
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib

........
  r3907 | efiring | 2007-10-02 04:30:29 -0400 (Tue, 02 Oct 2007) | 2 lines
  
  matplotlib.use() raises an exception if called too late
........

Modified Paths:
--------------
    branches/transforms/CHANGELOG
    branches/transforms/lib/matplotlib/__init__.py

Property Changed:
----------------
    branches/transforms/


Property changes on: branches/transforms
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk/matplotlib:1-3905
   + /trunk/matplotlib:1-3908

Modified: branches/transforms/CHANGELOG
===================================================================
--- branches/transforms/CHANGELOG       2007-10-03 12:50:04 UTC (rev 3908)
+++ branches/transforms/CHANGELOG       2007-10-03 12:51:16 UTC (rev 3909)
@@ -1,3 +1,6 @@
+2007-10-01 Made matplotlib.use() raise an exception if called after
+           backends has been imported.
+
 2007-09-30 Modified update* methods of Bbox and Interval so they
            work with reversed axes.  Prior to this, trying to
            set the ticks on a reversed axis failed with an

Modified: branches/transforms/lib/matplotlib/__init__.py
===================================================================
--- branches/transforms/lib/matplotlib/__init__.py      2007-10-03 12:50:04 UTC 
(rev 3908)
+++ branches/transforms/lib/matplotlib/__init__.py      2007-10-03 12:51:16 UTC 
(rev 3909)
@@ -716,6 +716,9 @@
     except:
         from config import rcParams, rcdefaults
 
+_use_error_msg = """ matplotlib.use() must be called *before* pylab
+or matplotlib.backends is imported for the first time."""
+
 def use(arg):
     """
     Set the matplotlib backend to one of the known backends.
@@ -732,6 +735,8 @@
     for the first time; or, if you are not using pylab, it must
     be called before importing matplotlib.backends.
     """
+    if 'matplotlib.backends' in sys.modules:
+        raise RuntimeError(_use_error_msg)
     be_parts = arg.split('.')
     name = validate_backend(be_parts[0])
     rcParams['backend'] = name


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to