Revision 19bf7c87 scripts/qapi-commands.py

b/scripts/qapi-commands.py
399 399
    elif o in ("-m", "--middle"):
400 400
        middle_mode = True
401 401
    elif o in ("-c", "--source"):
402
        do_h = True
403
    elif o in ("-h", "--header"):
404 402
        do_c = True
403
    elif o in ("-h", "--header"):
404
        do_h = True
405 405

  
406 406
if not do_c and not do_h:
407 407
    do_c = True
......
411 411
h_file = output_dir + prefix + h_file
412 412

  
413 413
def maybe_open(really, name, opt):
414
    class Null(object):
415
        def write(self, str):
416
            pass
417
        def read(self):
418
            return ''
419 414
    if really:
420 415
        return open(name, opt)
421 416
    else:
422
        return Null()
417
        import StringIO
418
        return StringIO.StringIO()
423 419

  
424 420
try:
425 421
    os.makedirs(output_dir)

Also available in: Unified diff