summary refs log tree commit diff
path: root/synapse/util/stringutils.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-04-30 01:20:06 +0100
committerGitHub <noreply@github.com>2018-04-30 01:20:06 +0100
commit683149c1f98fec9bc39835083e608057af535b10 (patch)
tree0816263ed10369755f1aea7090cd39ee4dea56d7 /synapse/util/stringutils.py
parentMerge branch 'rav/test_36' into develop (diff)
parentMerge branch 'develop' into py3-xrange-1 (diff)
downloadsynapse-683149c1f98fec9bc39835083e608057af535b10.tar.xz
Merge pull request #3151 from NotAFile/py3-xrange-1
Move more xrange to six
Diffstat (limited to 'synapse/util/stringutils.py')
-rw-r--r--synapse/util/stringutils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/util/stringutils.py b/synapse/util/stringutils.py
index 95a6168e16..b98b9dc6e4 100644
--- a/synapse/util/stringutils.py
+++ b/synapse/util/stringutils.py
@@ -15,6 +15,7 @@
 
 import random
 import string
+from six.moves import range
 
 _string_with_symbols = (
     string.digits + string.ascii_letters + ".,;:^&*-_+=#~@"
@@ -22,12 +23,12 @@ _string_with_symbols = (
 
 
 def random_string(length):
-    return ''.join(random.choice(string.ascii_letters) for _ in xrange(length))
+    return ''.join(random.choice(string.ascii_letters) for _ in range(length))
 
 
 def random_string_with_symbols(length):
     return ''.join(
-        random.choice(_string_with_symbols) for _ in xrange(length)
+        random.choice(_string_with_symbols) for _ in range(length)
     )