mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
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 <rstoyanov1@gmail.com>
This commit is contained in:
parent
5721e61000
commit
b25d1facae
@ -224,7 +224,7 @@ def get_bytes_dec(field):
|
|||||||
def is_string(value):
|
def is_string(value):
|
||||||
# Python 3 compatibility
|
# Python 3 compatibility
|
||||||
if "basestring" in __builtins__:
|
if "basestring" in __builtins__:
|
||||||
string_types = basestring
|
string_types = basestring # noqa: F821
|
||||||
else:
|
else:
|
||||||
string_types = (str, bytes)
|
string_types = (str, bytes)
|
||||||
return isinstance(value, string_types)
|
return isinstance(value, string_types)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user