Commits

Roman Prokofyev committed de03a8c

fix error when coverage output directory does not exist

  • Participants
  • Parent commits dc5e2b2

Comments (0)

Files changed (1)

File django_coverage/utils/coverage_report/html_report.py

                  * ``%(excluded_count)d``
                  * ``%(percent_covered)0.1f``
     """
-    # TODO: More robust directory checking and creation
-    outdir = os.path.abspath(outdir)
     test_timestamp = time.strftime('%a %Y-%m-%d %H:%M %Z')
     m_subdirname = 'modules'
     m_dir = os.path.join(outdir, m_subdirname)
-    try:
-        os.mkdir(m_dir)
-    except OSError:
-        pass
+    if not os.path.exists(m_dir):
+        os.makedirs(m_dir)
 
     total_lines = 0
     total_executed = 0