summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2019-05-08 21:04:01 +0200
committerStefan Sauer <ensonic@users.sf.net>2019-05-08 21:04:01 +0200
commitf87317d0981e3a4711cd394834a67eb419d399fe (patch)
treee5f3c1a46e186c7f85c15a380ad512b43ce98897
parent033108d6914027506999fe3d8af49333bdde5ad6 (diff)
downloadgtk-doc-f87317d0981e3a4711cd394834a67eb419d399fe.tar.gz
highlight: make style-file writable before appending
-rw-r--r--gtkdoc/highlight.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/gtkdoc/highlight.py b/gtkdoc/highlight.py
index 6023d33..ded674e 100644
--- a/gtkdoc/highlight.py
+++ b/gtkdoc/highlight.py
@@ -22,6 +22,7 @@
"""
Highlight sourcecode snippets.
"""
+import os, stat
from pygments import highlight
from pygments.lexers import CLexer
@@ -45,5 +46,6 @@ def highlight_code(code, lang='c'):
def append_style_defs(css_file_name):
+ os.chmod(css_file_name, stat.S_IWRITE)
with open(css_file_name, 'at', newline='\n', encoding='utf-8') as css:
css.write(HTML_FORMATTER.get_style_defs())