commit | 6be90cc08dc955b39ce8f8bd9b127be1efe52666 | [log] [tgz] |
---|---|---|
author | xiexs <xiexs@cn.fujitsu.com> | Fri Nov 27 03:41:52 2015 -0500 |
committer | xiexs <xiexs@cn.fujitsu.com> | Wed Dec 02 11:10:31 2015 +0000 |
tree | 249dbb5295d56a2f7476fae0eba18ed7b72588a7 | |
parent | edfefab83e55cb9fe3ae210e27309f54cf0379c4 [diff] |
Optimize "open" method with context manager Replace the classic open() method with opening context manager to open file so that the file will be closed even if an exception occurs. Change-Id: I0d53b7a38fee6a2ef8ce74496d220adc954afb98