This commit is contained in:
Maximilian Hils 2020-08-27 15:02:59 +02:00 committed by GitHub
parent 72dd567994
commit 8e5e43de24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ def check_option_type(name: str, value: typing.Any, typeinfo: Type) -> None:
typename = str(typeinfo)
if typename.startswith("typing.Union"):
if typename.startswith("typing.Union") or typename.startswith("typing.Optional"):
for T in union_types(typeinfo):
try:
check_option_type(name, value, T)