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:
Rishi Gupta
2017-07-07 17:46:51 -07:00
committed by Tim Abbott
parent a610cec8fc
commit 3bc74113ad
5 changed files with 13 additions and 13 deletions

View File

@@ -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