diff options
Diffstat (limited to 'scripts/qapi-types.py')
-rw-r--r-- | scripts/qapi-types.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index ae644bc06f..b56225bdaa 100644 --- a/scripts/qapi-types.py +++ b/scripts/qapi-types.py @@ -183,9 +183,9 @@ for o, a in opts: elif o in ("-o", "--output-dir"): output_dir = a + "/" elif o in ("-c", "--source"): - do_h = True - elif o in ("-h", "--header"): do_c = True + elif o in ("-h", "--header"): + do_h = True if not do_c and not do_h: do_c = True @@ -201,13 +201,11 @@ except os.error, e: raise def maybe_open(really, name, opt): - class Null(object): - def write(self, str): - pass - def read(self): - return '' if really: return open(name, opt) + else: + import StringIO + return StringIO.StringIO() fdef = maybe_open(do_c, c_file, 'w') fdecl = maybe_open(do_h, h_file, 'w') |