From ba1cf06be624574fcb0201924ce3828d80476a98 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 20 Sep 2017 07:41:47 +0200 Subject: [PATCH] Reintroduce handling for typing.Union.__union_params__ Looks like Python 3.5.2 doesn't have typing.Union.__args__. --- qutebrowser/commands/command.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py index 8559099f2..48db8380a 100644 --- a/qutebrowser/commands/command.py +++ b/qutebrowser/commands/command.py @@ -405,7 +405,11 @@ class Command: # We also can't use isinstance here because typing.Union doesn't # support that. # pylint: disable=no-member,useless-suppression - types = list(typ.__args__) + try: + types = list(typ.__args__) + except AttributeError: + # Older Python 3.5 patch versions + types = list(typ.__union_params__) # pylint: enable=no-member,useless-suppression if param.default is not inspect.Parameter.empty: types.append(type(param.default))