zthumbor: Fix strict_optional errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-07-04 18:00:50 -07:00 committed by Tim Abbott
parent 8a03f8a070
commit d7745674dc
2 changed files with 2 additions and 13 deletions

View File

@ -12,6 +12,7 @@ check_untyped_defs = True
disallow_untyped_defs = True
disallow_any_generics = True
warn_no_return = True
strict_optional = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
@ -29,16 +30,3 @@ ignore_missing_imports = True
# Warn of unreachable or redundant code.
warn_unreachable = True
#
#
# STRICT OPTIONAL
#
#
strict_optional = True
# General exclusions to work on
[mypy-zthumbor.loaders.helpers]
strict_optional = False

View File

@ -44,4 +44,5 @@ def separate_url_and_source_type(url):
# type: (Text) -> Tuple[Text, Text]
THUMBNAIL_URL_PATT = re.compile('^(?P<actual_url>.+)/source_type/(?P<source_type>.+)')
matches = THUMBNAIL_URL_PATT.match(url)
assert matches is not None
return (matches.group('source_type'), matches.group('actual_url'))