Fix zerver.lib.utils.generate_random_token.

generate_random_token used to return a value of type six.binary_type
and its return type was annotated as `str`.  This commit fixes that
by making it return a value of type `six.text_type` and updating
the annotation accordingly.
Also fix clashing annnotations.
This commit is contained in:
Eklavya Sharma
2016-06-12 15:54:27 +05:30
committed by Tim Abbott
parent 56d5785c2e
commit 10f2ec043d
3 changed files with 4 additions and 4 deletions

View File

@@ -110,5 +110,5 @@ def log_statsd_event(name):
statsd.incr(event_name)
def generate_random_token(length):
# type: (int) -> str
return base64.b16encode(os.urandom(length // 2)).lower()
# type: (int) -> text_type
return base64.b16encode(os.urandom(length // 2)).decode('utf-8').lower()