Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
zthumbor: Fix strict_optional errors.
Anders Kaseorgd7745674dca9
diff --git a/mypy.ini b/mypy.iniindex eb93645605a..b6ebfb5cd64 100644--- a/mypy.ini+++ b/mypy.ini@@ -12,6 +12,7 @@ check_untyped_defs = Truedisallow_untyped_defs = Truedisallow_any_generics = Truewarn_no_return = True+strict_optional = Trueno_implicit_optional = Truewarn_redundant_casts = Truewarn_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 = Falsediff --git a/zthumbor/loaders/helpers.py b/zthumbor/loaders/helpers.pyindex b595256dec0..d85bb802e52 100644--- a/zthumbor/loaders/helpers.py+++ b/zthumbor/loaders/helpers.py@@ -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 Nonereturn (matches.group('source_type'), matches.group('actual_url'))