This commit is contained in:
Kovid Goyal 2021-12-16 10:48:55 +05:30
commit 183e5c3be3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -530,7 +530,8 @@ class Device(DeviceConfig, DevicePlugin):
if not os.access(sz, os.R_OK): if not os.access(sz, os.R_OK):
continue continue
try: try:
sz = int(open(sz, 'rb').read().decode('utf-8')) with open(sz, 'rb') as szf:
sz = int(szf.read().decode('utf-8'))
except: except:
continue continue
if sz > 0: if sz > 0: