Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Commit c482c8c

Browse files
committed
Fix Travis and a few Python 3 fixes
1 parent b45d330 commit c482c8c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ python:
55
- "2.7"
66
- "3.5"
77
- "3.6"
8-
- "3.7"
98
#install:
109
# - pip install dbus-python
1110
# - pip install python-utmp

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ clean:
3333
$(MAKE) -C docs clean
3434

3535
test:
36+
./dstat --version
3637
./dstat -taf 1 5
3738
./dstat -t --all-plugins 1 5
3839

dstat

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22

33
### This program is free software; you can redistribute it and/or
44
### modify it under the terms of the GNU General Public License
@@ -151,7 +151,7 @@ class Options:
151151

152152
elif opt in ['--all-plugins']:
153153
### Make list unique in a fancy fast way
154-
plugins = {}.fromkeys(allplugins).keys()
154+
plugins = list({}.fromkeys(allplugins).keys())
155155
plugins.sort()
156156
self.plugins += plugins
157157
elif opt in ['--bits']:
@@ -1837,7 +1837,7 @@ def set_theme():
18371837
def ticks():
18381838
"Return the number of 'ticks' since bootup"
18391839
try:
1840-
for line in open('/proc/uptime', 'r', 0).readlines():
1840+
for line in open('/proc/uptime', 'r').readlines():
18411841
l = line.split()
18421842
if len(l) < 2: continue
18431843
return float(l[0])
@@ -2555,12 +2555,12 @@ def main():
25552555
### Prepare CSV output file (unbuffered)
25562556
if op.output:
25572557
if not os.path.exists(op.output):
2558-
outputfile = open(op.output, 'w', 0)
2558+
outputfile = open(op.output, 'w')
25592559
outputfile.write('"Dstat %s CSV output"\n' % VERSION)
25602560
header = ('"Author:","Dag Wieers <[email protected]>"','','','','"URL:"','"http://dag.wieers.com/home-made/dstat/"\n')
25612561
outputfile.write(char['sep'].join(header))
25622562
else:
2563-
outputfile = open(op.output, 'a', 0)
2563+
outputfile = open(op.output, 'a')
25642564
outputfile.write('\n\n')
25652565

25662566
header = ('"Host:"','"%s"' % hostname,'','','','"User:"','"%s"\n' % user)
@@ -2571,7 +2571,7 @@ def main():
25712571
### Create pidfile
25722572
if op.pidfile:
25732573
try:
2574-
pidfile = open(op.pidfile, 'w', 0)
2574+
pidfile = open(op.pidfile, 'w')
25752575
pidfile.write(str(os.getpid()))
25762576
pidfile.close()
25772577
except Exception as e:

0 commit comments

Comments
 (0)