Commit 0866c31b authored by Cole Robinson's avatar Cole Robinson Committed by Radim Krčmář

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: default avatarCole Robinson <crobinso@redhat.com>
Reviewed-and-tested-by: default avatarStefan Raspl <stefan.raspl@linux.vnet.ibm.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent 6ade1ae8
...@@ -1615,7 +1615,7 @@ def assign_globals(): ...@@ -1615,7 +1615,7 @@ def assign_globals():
global PATH_DEBUGFS_TRACING global PATH_DEBUGFS_TRACING
debugfs = '' debugfs = ''
for line in file('/proc/mounts'): for line in open('/proc/mounts'):
if line.split(' ')[0] == 'debugfs': if line.split(' ')[0] == 'debugfs':
debugfs = line.split(' ')[1] debugfs = line.split(' ')[1]
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment