mirror of
https://github.com/robweber/xbmcbackup.git
synced 2025-11-23 11:41:30 +01:00
use contextlib
This commit is contained in:
@@ -86,9 +86,8 @@ class XBMCFileSystem(Vfs):
|
||||
return xbmcvfs.exists(aFile)
|
||||
|
||||
def fileSize(self, filename):
|
||||
f = xbmcvfs.File(filename)
|
||||
result = f.size() / 1024 # bytes to kilobytes
|
||||
f.close()
|
||||
with xbmcvfs.File(filename) as f:
|
||||
result = f.size() / 1024 # bytes to kilobytes
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user