diff options
author | Adrian Tschira <nota@notafile.com> | 2018-04-28 13:57:00 +0200 |
---|---|---|
committer | Adrian Tschira <nota@notafile.com> | 2018-04-28 13:57:00 +0200 |
commit | d82b6ea9e68150aece1fc46cb0821b31cf728910 (patch) | |
tree | b4a57fab25332b4be822ede7b38a67868caa28d3 /synapse/util/stringutils.py | |
parent | Merge pull request #3127 from matrix-org/rav/deferred_timeout (diff) | |
download | synapse-d82b6ea9e68150aece1fc46cb0821b31cf728910.tar.xz |
Move more xrange to six
plus a bonus next() Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'synapse/util/stringutils.py')
-rw-r--r-- | synapse/util/stringutils.py | 5 |
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) ) |