mirror of
https://github.com/zulip/zulip.git
synced 2025-10-27 18:13:58 +00:00
utils: Cast generate_random_token to str.
Having this be Text is forcing various URLs, emails, etc to be type annotated as Text.
This commit is contained in:
@@ -116,8 +116,8 @@ def log_statsd_event(name):
|
||||
statsd.incr(event_name)
|
||||
|
||||
def generate_random_token(length):
|
||||
# type: (int) -> Text
|
||||
return base64.b16encode(os.urandom(length // 2)).decode('utf-8').lower()
|
||||
# type: (int) -> str
|
||||
return str(base64.b16encode(os.urandom(length // 2)).decode('utf-8').lower())
|
||||
|
||||
def mkdir_p(path):
|
||||
# type: (str) -> None
|
||||
|
||||
Reference in New Issue
Block a user