Selaa lähdekoodia

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>
Markus Armbruster 10 vuotta sitten
vanhempi
commit
c4f498fe85
1 muutettua tiedostoa jossa 6 lisäystä ja 5 poistoa
  1. 6 5
      scripts/qapi.py

+ 6 - 5
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: