summaryrefslogtreecommitdiff
path: root/tools/kvm/kvm_stat
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2018-03-23 18:07:17 -0400
committerRadim Krčmář <rkrcmar@redhat.com>2018-03-28 22:47:06 +0200
commit0866c31bf32fbd05dd25b6ed4976fa9134773227 (patch)
tree737b4b1586d6f6238cdc3f8af7cd088091cb0a34 /tools/kvm/kvm_stat
parent6ade1ae84c9236cbb58de4b17f770f2791106676 (diff)
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>
Diffstat (limited to 'tools/kvm/kvm_stat')
-rwxr-xr-xtools/kvm/kvm_stat/kvm_stat2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
index 645d4bb69f5f..651b7f08bb2c 100755
--- a/tools/kvm/kvm_stat/kvm_stat
+++ b/tools/kvm/kvm_stat/kvm_stat
@@ -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