title: How to workaround `exist_ok` missing on Python 2.7?
body: <p>On Python 2.7 <code>os.makedirs()</code> is missing <code>exist_ok</code>. This is available in Python 3 only.</p>
  
  <p>I know that this is the a working work around:</p>
  
  <pre><code>try:
      os.makedirs(settings.STATIC_ROOT)
  except OSError as e:
      if e.errno != errno.EEXIST:
          raise
  </code></pre>
  
  <p>I could create a custom <code>my_make_dirs()</code> method and use this, instead of <code>os.makedirs()</code>, but this is not nice.</p>
  
  <p>What is the most pythonic work around, if you forced to support Python 2.7?</p>
  
  <p>AFAIK <a href="http://python-future.org/" rel="noreferrer">python-future</a> or <a href="https://pythonhosted.org/six/" rel="noreferrer">six</a> won't help here.</p>