Skip to content

Commit a5b4d73

Browse files
author
cclauss
authored
Define xrange() for Python 3
1 parent e4cbf18 commit a5b4d73

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dm_control/mujoco/thread_safety_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
MODEL = assets.get_contents('cartpole.xml')
3131
NUM_STEPS = 10
3232

33+
try:
34+
xrange # Python 2
35+
except NameError:
36+
xrange = range # Python 3
37+
3338

3439
class ThreadSafetyTest(absltest.TestCase):
3540

0 commit comments

Comments
 (0)