Permalink
Browse files

shared/scripts/kvm_overcommit_guest.py: Fixes found by pylint

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
  • Loading branch information...
1 parent cce9d0b commit bc90094120710f3d05395817f554c9a0a3a25c9b @lmr lmr committed Sep 27, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 shared/scripts/ksm_overcommit_guest.py
View
12 shared/scripts/ksm_overcommit_guest.py
@@ -86,7 +86,7 @@ def value_page(self, value):
@return: return array of bytes size PAGE_SIZE.
"""
a = array.array("B")
- for i in range((PAGE_SIZE / a.itemsize)):
+ for _ in range((PAGE_SIZE / a.itemsize)):
try:
a.append(value)
except Exception:
@@ -103,7 +103,7 @@ def random_page(self, seed):
"""
random.seed(seed)
a = array.array(self.allocate_by)
- for i in range(PAGE_SIZE / a.itemsize):
+ for _ in range(PAGE_SIZE / a.itemsize):
a.append(random.randrange(0, sys.maxint))
return a
@@ -119,7 +119,7 @@ def value_fill(self, value=None):
if value is None:
value = self.static_value
page = self.value_page(value)
- for pages in range(self.npages):
+ for _ in range(self.npages):
page.tofile(self.f)
print "PASS: Mem value fill"
@@ -139,7 +139,7 @@ def value_check(self, value=None):
if value is None:
value = self.static_value
page = self.value_page(value)
- for pages in range(self.npages):
+ for _ in range(self.npages):
pf = array.array("B")
pf.fromfile(self.f, PAGE_SIZE / pf.itemsize)
if not (page == pf):
@@ -229,8 +229,8 @@ def main():
print "PASS: Start"
end = False
while not end:
- str = raw_input()
- exec str
+ sr = raw_input()
+ exec sr
if __name__ == "__main__":

0 comments on commit bc90094

Please sign in to comment.