mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
tests: Reorder python version logic to be more clear.
This commit is contained in:
@@ -346,12 +346,12 @@ so maybe we shouldn't mark it as intentionally undocumented in the urls.
|
|||||||
E.g. typing.Union[typing.List[typing.Dict[str, typing.Any]], NoneType]
|
E.g. typing.Union[typing.List[typing.Dict[str, typing.Any]], NoneType]
|
||||||
needs to be mapped to list."""
|
needs to be mapped to list."""
|
||||||
|
|
||||||
if sys.version_info < (3, 6) and type(t) is type(Union): # nocoverage # in python3.6+
|
if sys.version_info < (3, 7): # nocoverage # python 3.5-3.6
|
||||||
|
if sys.version_info < (3, 6) and type(t) is type(Union): # python 3.5 has special consideration for Union
|
||||||
origin = Union
|
origin = Union
|
||||||
else: # nocoverage # in python3.5. I.E. this is used in python3.6+
|
else:
|
||||||
origin = getattr(t, "__origin__", None)
|
origin = getattr(t, "__origin__", None)
|
||||||
|
else: # nocoverage # python3.7+
|
||||||
if sys.version_info > (3, 6): # nocoverage # in < python3.7
|
|
||||||
origin = getattr(t, "__origin__", None)
|
origin = getattr(t, "__origin__", None)
|
||||||
t_name = getattr(t, "_name", None)
|
t_name = getattr(t, "_name", None)
|
||||||
if origin == list:
|
if origin == list:
|
||||||
|
|||||||
Reference in New Issue
Block a user