Permalink
Browse files

Bugfix, porbably is faster

  • Loading branch information...
1 parent 7c7f71a commit 256cc94cd25c1574b81b91caabf4752b51d30a97 @dagwieers committed May 17, 2006
Showing with 3 additions and 2 deletions.
  1. +1 −0 ChangeLog
  2. +2 −2 dstat
View
@@ -2,6 +2,7 @@
- Reduced width for 1024 or 1000 base values from 4 to 3
- Added load to default output (since we have extra space for it)
- Changed default (silver) color of delimiter to gray
+- Fixed sum() and enumerate() only when it isn't there (Jesse Young)
* 0.6.2 - Cumbernauld - released 08/03/2006
- Fixed situation where no TERM environment variable was set (William Webber)
View
@@ -36,7 +36,7 @@ if sys.version_info < (2, 2):
sys.exit('error: Python 2.2 or later required, try dstat15 instead')
### Workaround for python < 2.3
-if not callable('enumerate'):
+if 'enumerate' not in __builtins__.__dict__.keys():
if sys.version_info < (2, 3) and sys.version_info >= (2, 2):
def enumerate(sequence):
index = 0
@@ -53,7 +53,7 @@ if not callable('enumerate'):
return list
### Workaround for python < 2.3
-if not callable('sum'):
+if 'sum' not in __builtins__.__dict__.keys():
def sum(sequence):
ret = 0
for i in sequence:

0 comments on commit 256cc94

Please sign in to comment.