diff options
| -rw-r--r-- | kombu/utils/encoding.py | 10 | ||||
| -rw-r--r-- | kombu/utils/functional.py | 4 | ||||
| -rw-r--r-- | t/unit/utils/test_json.py | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/kombu/utils/encoding.py b/kombu/utils/encoding.py index 551cf5f3..1c845af5 100644 --- a/kombu/utils/encoding.py +++ b/kombu/utils/encoding.py @@ -76,7 +76,7 @@ else: def str_to_bytes(s): # noqa """Convert str to bytes.""" - if isinstance(s, unicode): + if isinstance(s, unicode): # noqa: F821 return s.encode() return s @@ -90,9 +90,9 @@ else: def default_encode(obj, file=None): # noqa """Get default encoding.""" - return unicode(obj, default_encoding(file)) + return unicode(obj, default_encoding(file)) # noqa: F821 - str_t = unicode + str_t = unicode # noqa: F821 ensure_bytes = str_to_bytes @@ -130,10 +130,10 @@ else: def _safe_str(s, errors='replace', file=None): # noqa encoding = default_encoding(file) try: - if isinstance(s, unicode): + if isinstance(s, unicode): # noqa: F821 return _ensure_str(s.encode(encoding, errors), encoding, errors) - return unicode(s, encoding, errors) + return unicode(s, encoding, errors) # noqa: F821 except Exception as exc: return '<Unrepresentable {0!r}: {1!r} {2!r}>'.format( type(s), exc, '\n'.join(traceback.format_stack())) diff --git a/kombu/utils/functional.py b/kombu/utils/functional.py index b191a759..3fbb5d46 100644 --- a/kombu/utils/functional.py +++ b/kombu/utils/functional.py @@ -236,8 +236,8 @@ class lazy(object): def __cmp__(self, rhs): if isinstance(rhs, self.__class__): - return -cmp(rhs, self()) - return cmp(self(), rhs) + return -cmp(rhs, self()) # noqa: F821 + return cmp(self(), rhs) # noqa: F821 def maybe_evaluate(value): diff --git a/t/unit/utils/test_json.py b/t/unit/utils/test_json.py index ae7b374d..b694443e 100644 --- a/t/unit/utils/test_json.py +++ b/t/unit/utils/test_json.py @@ -83,7 +83,7 @@ class test_dumps_loads: @skip.if_python3() def test_loads_buffer(self): - assert loads(buffer(dumps({'x': 'z'}))) == {'x': 'z'} + assert loads(buffer(dumps({'x': 'z'}))) == {'x': 'z'} # noqa: F821 def test_loads_DecodeError(self): _loads = Mock(name='_loads') |
