projects
/
deliverable
/
barectf.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a0782f
)
Catch write errors
author
Philippe Proulx
<eeppeliteloop@gmail.com>
Wed, 12 Nov 2014 20:23:36 +0000
(15:23 -0500)
committer
Philippe Proulx
<eeppeliteloop@gmail.com>
Wed, 12 Nov 2014 20:23:36 +0000
(15:23 -0500)
barectf/cli.py
patch
|
blob
|
blame
|
history
diff --git
a/barectf/cli.py
b/barectf/cli.py
index b4541603eb161b7605fe488dceeb1008b482e08e..04cb52dc0a7f575262712c00a47b59284ffa6513 100644
(file)
--- a/
barectf/cli.py
+++ b/
barectf/cli.py
@@
-1875,8
+1875,12
@@
class BarectfCodeGenerator:
# name: file name
# contents: file contents
def _write_file(self, name, contents):
- with open(os.path.join(self._output, name), 'w') as f:
- f.write(contents)
+ path = os.path.join(self._output, name)
+ try:
+ with open(path, 'w') as f:
+ f.write(contents)
+ except Exception as e:
+ _perror('cannot write "{}": {}'.format(path, e))
# Converts a C block to actual C source lines.
#
This page took
0.023188 seconds
and
4
git commands to generate.