qapi: Generators crash when --output-dir isn't given, fix

Backports commit c4f498fe8532cdacc609262b104322911108df54 from qemu
This commit is contained in:
Markus Armbruster 2018-02-19 16:32:48 -05:00 committed by Lioncash
parent 741783073f
commit 809b439562
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1032,11 +1032,12 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file,
c_file = output_dir + prefix + c_file c_file = output_dir + prefix + c_file
h_file = output_dir + prefix + h_file h_file = output_dir + prefix + h_file
try: if output_dir:
os.makedirs(output_dir) try:
except os.error, e: os.makedirs(output_dir)
if e.errno != errno.EEXIST: except os.error, e:
raise if e.errno != errno.EEXIST:
raise
def maybe_open(really, name, opt): def maybe_open(really, name, opt):
if really: if really: