mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-16 11:44:52 +00:00
tools/kvm_stat: Don't use deprecated file()
$ python3 tools/kvm/kvm_stat/kvm_stat
Traceback (most recent call last):
File "tools/kvm/kvm_stat/kvm_stat", line 1668, in <module>
main()
File "tools/kvm/kvm_stat/kvm_stat", line 1639, in main
assign_globals()
File "tools/kvm/kvm_stat/kvm_stat", line 1618, in assign_globals
for line in file('/proc/mounts'):
NameError: name 'file' is not defined
open() is the python3 way, and works on python2.6+
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-and-tested-by: Stefan Raspl <stefan.raspl@linux.vnet.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:
parent
6ade1ae84c
commit
0866c31bf3
1 changed files with 1 additions and 1 deletions
|
|
@ -1615,7 +1615,7 @@ def assign_globals():
|
|||
global PATH_DEBUGFS_TRACING
|
||||
|
||||
debugfs = ''
|
||||
for line in file('/proc/mounts'):
|
||||
for line in open('/proc/mounts'):
|
||||
if line.split(' ')[0] == 'debugfs':
|
||||
debugfs = line.split(' ')[1]
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue