]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
nvme.py: Explicit close is redundant
authorTony Asleson <tasleson@redhat.com>
Thu, 26 Mar 2020 18:07:46 +0000 (13:07 -0500)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Apr 2020 09:00:14 +0000 (11:00 +0200)
One of the benefits of using 'with' statement for open files is the
close is going to be called regardless of what happens.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
nvmet/nvme.py

index fdec4ffcb92f8083af817f45154d7f8983793275..687a45a1e197ff8ca8bc6fb90406170f70b53479 100644 (file)
@@ -302,7 +302,6 @@ class Root(CFSNode):
             f.write("\n")
             f.flush()
             os.fsync(f.fileno())
-            f.close()
 
         os.rename(savefile + ".temp", savefile)