From 2e3b14a46cdb60266348b6b23997808448d20a11 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 7 Sep 2023 11:11:36 +0100 Subject: [PATCH] Fix flake8 issues Change-Id: I2d615054b5b3ad3e1ab992a8488e4c10bd86afd7 Signed-off-by: Stephen Finucane --- wsme/tests/test_restjson.py | 2 +- wsme/tests/test_restxml.py | 2 +- wsmeext/sphinxext.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wsme/tests/test_restjson.py b/wsme/tests/test_restjson.py index fa3afb6..bdc2091 100644 --- a/wsme/tests/test_restjson.py +++ b/wsme/tests/test_restjson.py @@ -72,7 +72,7 @@ def prepare_result(value, datatype): return value if datatype == wsme.types.bytes: return value.encode('ascii') - if type(value) != datatype: + if type(value) is not datatype: print(type(value), datatype) return datatype(value) return value diff --git a/wsme/tests/test_restxml.py b/wsme/tests/test_restxml.py index 7bea454..40db1e9 100644 --- a/wsme/tests/test_restxml.py +++ b/wsme/tests/test_restxml.py @@ -45,7 +45,7 @@ def dumpxml(key, obj, datatype=None): continue o = obj[name] el.append(dumpxml(name, o, attr.datatype)) - elif type(obj) == dict: + elif type(obj) is dict: for name, value in obj.items(): el.append(dumpxml(name, value)) print(obj, datatype, et.tostring(el)) diff --git a/wsmeext/sphinxext.py b/wsmeext/sphinxext.py index 2463956..749fd3a 100644 --- a/wsmeext/sphinxext.py +++ b/wsmeext/sphinxext.py @@ -191,7 +191,7 @@ class TypeDocumenter(autodoc.ClassDocumenter): option_spec = dict( autodoc.ClassDocumenter.option_spec, - **{'protocols': lambda l: [v.strip() for v in l.split(',')], + **{'protocols': lambda line: [v.strip() for v in line.split(',')], 'samples-slot': check_samples_slot, })