summaryrefslogtreecommitdiff
path: root/scripts/qapi.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-09-03 10:24:25 +0200
committerMarkus Armbruster <armbru@redhat.com>2015-09-04 15:47:16 +0200
commitc4f498fe8532cdacc609262b104322911108df54 (patch)
tree28406ac68a1d1b57eb2e664432e8a3186db8bc87 /scripts/qapi.py
parent94a3f0af388820d74a9d89d1a856d2baa448c696 (diff)
downloadqemu-c4f498fe8532cdacc609262b104322911108df54.tar.gz
qemu-c4f498fe8532cdacc609262b104322911108df54.tar.bz2
qemu-c4f498fe8532cdacc609262b104322911108df54.zip
qapi: Generators crash when --output-dir isn't given, fix
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi.py')
-rw-r--r--scripts/qapi.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py
index ac0e45e2e6..817d824bea 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1035,11 +1035,12 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file,
c_file = output_dir + prefix + c_file
h_file = output_dir + prefix + h_file
- try:
- os.makedirs(output_dir)
- except os.error, e:
- if e.errno != errno.EEXIST:
- raise
+ if output_dir:
+ try:
+ os.makedirs(output_dir)
+ except os.error, e:
+ if e.errno != errno.EEXIST:
+ raise
def maybe_open(really, name, opt):
if really: