From b25d1facaedae7a1bd7154fe28f909c7e961a93c Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Wed, 31 Jul 2019 07:08:20 +0100 Subject: [PATCH] pb2dict: Disable undefined name 'basestring' The following error is falsely reported by flake8: lib/py/images/pb2dict.py:266:24: F821 undefined name 'basestring' This error occurs because `basestring` is not available in Python 3, however the if condition on the line above ensures that this error will not occur at run time. Signed-off-by: Radostin Stoyanov --- lib/py/images/pb2dict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/py/images/pb2dict.py b/lib/py/images/pb2dict.py index c4ce736e8..6b4a772c7 100644 --- a/lib/py/images/pb2dict.py +++ b/lib/py/images/pb2dict.py @@ -224,7 +224,7 @@ def get_bytes_dec(field): def is_string(value): # Python 3 compatibility if "basestring" in __builtins__: - string_types = basestring + string_types = basestring # noqa: F821 else: string_types = (str, bytes) return isinstance(value, string_types)