mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Fix undefined variable f in 'finally' clause of verify-flags-underscore.py
This commit is contained in:
parent
8800450c5f
commit
211fe33f40
@ -36,7 +36,7 @@ def is_binary(pathname):
|
|||||||
@author: Trent Mick <TrentM@ActiveState.com>
|
@author: Trent Mick <TrentM@ActiveState.com>
|
||||||
@author: Jorge Orpinel <jorge@orpinel.com>"""
|
@author: Jorge Orpinel <jorge@orpinel.com>"""
|
||||||
try:
|
try:
|
||||||
f = open(pathname, 'r')
|
with open(pathname, 'r') as f:
|
||||||
CHUNKSIZE = 1024
|
CHUNKSIZE = 1024
|
||||||
while 1:
|
while 1:
|
||||||
chunk = f.read(CHUNKSIZE)
|
chunk = f.read(CHUNKSIZE)
|
||||||
@ -46,8 +46,7 @@ def is_binary(pathname):
|
|||||||
break # done
|
break # done
|
||||||
except:
|
except:
|
||||||
return True
|
return True
|
||||||
finally:
|
|
||||||
f.close()
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_all_files(rootdir):
|
def get_all_files(rootdir):
|
||||||
|
Loading…
Reference in New Issue
Block a user