[yt-svn] commit/yt: xarthisius: Merged in ngoldbaum/yt (pull request #1599)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Jun 1 10:17:47 PDT 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/239abe7c09fe/
Changeset:   239abe7c09fe
Branch:      yt
User:        xarthisius
Date:        2015-06-01 17:17:36+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1599)

Avoid raising error in plot_container.save when output directory exists
Affected #:  1 file

diff -r 1dee4eb0634354c90ace1ba14a6d2b4ed4237882 -r 239abe7c09fe6680691383eddb189965fe6522fe yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -14,7 +14,9 @@
 #-----------------------------------------------------------------------------
 from yt.extern.six.moves import builtins
 from yt.extern.six import iteritems
+
 import base64
+import errno
 import numpy as np
 import matplotlib
 import os
@@ -536,7 +538,13 @@
             name = str(self.ds)
         name = os.path.expanduser(name)
         if name[-1] == os.sep and not os.path.isdir(name):
-            os.mkdir(name)
+            try:
+                os.mkdir(name)
+            except OSError as e:
+                if e.errno == errno.EEXIST:
+                    pass
+                else:
+                    raise
         if os.path.isdir(name) and name != str(self.ds):
             name = name + (os.sep if name[-1] != os.sep else '') + str(self.ds)
         if suffix is None:

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the yt-svn mailing list