From 696219dab9c71cdc73da2f7428f5575aa5a6436c Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 8 Jun 2020 23:18:26 +0200 Subject: [PATCH] util/ostree: accept typing.List for List[str] In python 3.6 the value of `__origin__` for typing.List[str] is typing.List. This then changed to the actual `list` type in later versions. Accept both versions. --- osbuild/util/ostree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osbuild/util/ostree.py b/osbuild/util/ostree.py index 5467d776..775c2743 100644 --- a/osbuild/util/ostree.py +++ b/osbuild/util/ostree.py @@ -2,6 +2,7 @@ import contextlib import json import os import tempfile +import typing from typing import List @@ -17,7 +18,7 @@ class Param: origin = getattr(self.type, "__origin__", None) if origin: self.typecheck(value, origin) - if origin is list: + if origin is list or origin is typing.List: self.check_list(value, self.type) else: raise NotImplementedError(origin)