Re: [PATCH v5 30/36] qapi/gen.py: update write() to be more idiomatic

2020-10-07 Thread John Snow
On 10/7/20 8:32 AM, Markus Armbruster wrote: John Snow writes: Make the file handling here just a tiny bit more idiomatic. (I realize this is heavily subjective.) Use exist_ok=True for os.makedirs and remove the exception, use fdopen() to wrap the file descriptor in a File-like object, and

Re: [PATCH v5 30/36] qapi/gen.py: update write() to be more idiomatic

2020-10-07 Thread Markus Armbruster
John Snow writes: > Make the file handling here just a tiny bit more idiomatic. > (I realize this is heavily subjective.) > > Use exist_ok=True for os.makedirs and remove the exception, > use fdopen() to wrap the file descriptor in a File-like object, > and use a context manager for managing the

[PATCH v5 30/36] qapi/gen.py: update write() to be more idiomatic

2020-10-05 Thread John Snow
Make the file handling here just a tiny bit more idiomatic. (I realize this is heavily subjective.) Use exist_ok=True for os.makedirs and remove the exception, use fdopen() to wrap the file descriptor in a File-like object, and use a context manager for managing the file pointer. Signed-off-by: