Skip to content

Commit

Permalink
Remove last usage of six library
Browse files Browse the repository at this point in the history
Change-Id: Ib3981c1c244684e2d4fd35ebe96dccedc1c3e88e
  • Loading branch information
andreykurilin committed Apr 7, 2020
1 parent 76e8939 commit e824bf5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rally/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
import ctypes
import heapq
import inspect
import io
import multiprocessing
import os
import queue as queue_m
import random
import re
import shutil
Expand All @@ -30,8 +32,6 @@
import time
import uuid

from six import moves

from rally.common.io import junit
from rally.common import logging
from rally import exceptions
Expand All @@ -53,7 +53,7 @@ def __setattr__(self, key, value):

class EnumMixin(object):
def __iter__(self):
for k, v in moves.map(lambda x: (x, getattr(self, x)), dir(self)):
for k, v in map(lambda x: (x, getattr(self, x)), dir(self)):
if not k.startswith("_"):
yield v

Expand All @@ -63,7 +63,7 @@ def __init__(self):
self.stdout = sys.stdout

def __enter__(self):
sys.stdout = moves.StringIO()
sys.stdout = io.StringIO()
return sys.stdout

def __exit__(self, type, value, traceback):
Expand All @@ -75,7 +75,7 @@ def __init__(self):
self.stderr = sys.stderr

def __enter__(self):
sys.stderr = moves.StringIO()
sys.stderr = io.StringIO()
return sys.stderr

def __exit__(self, type, value, traceback):
Expand Down Expand Up @@ -525,7 +525,7 @@ def interruptable_sleep(sleep_time, atomic_delay=0.1):
if sleep_time < 1:
return time.sleep(sleep_time)

for x in moves.xrange(int(sleep_time / atomic_delay)):
for x in range(int(sleep_time / atomic_delay)):
time.sleep(atomic_delay)

left = sleep_time - (int(sleep_time / atomic_delay)) * atomic_delay
Expand Down Expand Up @@ -573,7 +573,7 @@ def timeout_thread(queue):
try:
next_thread = queue.get(timeout=timeout)
all_threads.append(next_thread)
except (moves.queue.Empty, ValueError):
except (queue_m.Empty, ValueError):
# NOTE(rvasilets) Empty means that timeout was occurred.
# ValueError means that timeout lower than 0.
if thread.is_alive():
Expand Down

0 comments on commit e824bf5

Please sign in to comment.