summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2019-02-21 09:26:10 -0800
committerTim Burke <tim.burke@gmail.com>2019-02-21 09:26:32 -0800
commit0ee7c8272e0de2d8c44fd98306d54fc290d74f38 (patch)
tree76caa19f78bd0a17fe28fe54fc8c5fe6ecc38bdc
parent2ff36fde575fa6987ee5954f526ad6c9460633a5 (diff)
downloadpython-swiftclient-0ee7c8272e0de2d8c44fd98306d54fc290d74f38.tar.gz
Make proper functions instead of assigning lambdas
Change-Id: I89255f6923c649c7b9d3d36e96c09f8bc4f51a3c
-rw-r--r--swiftclient/client.py4
-rw-r--r--swiftclient/service.py4
-rw-r--r--tox.ini2
3 files changed, 7 insertions, 3 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index 6a2b43b..4406689 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -1885,7 +1885,9 @@ class Connection(object):
reset = getattr(contents, 'reset', None)
if tell and seek:
orig_pos = tell()
- reset_func = lambda *a, **k: seek(orig_pos)
+
+ def reset_func(*a, **kw):
+ seek(orig_pos)
elif reset:
reset_func = reset
return self._retry(reset_func, put_object, container, obj, contents,
diff --git a/swiftclient/service.py b/swiftclient/service.py
index 71c36ec..8f3648e 100644
--- a/swiftclient/service.py
+++ b/swiftclient/service.py
@@ -451,7 +451,9 @@ class SwiftService(object):
**_default_local_options
)
process_options(self._options)
- create_connection = lambda: get_conn(self._options)
+
+ def create_connection():
+ return get_conn(self._options)
self.thread_manager = MultiThreadingManager(
create_connection,
segment_threads=self._options['segment_threads'],
diff --git a/tox.ini b/tox.ini
index fb639d0..bd20632 100644
--- a/tox.ini
+++ b/tox.ini
@@ -77,7 +77,7 @@ commands=
# H403: multi line docstrings should end on a new line
# H404: multi line docstring should start without a leading new line
# H405: multi line docstring summary not separated with an empty line
-ignore = E731,H101,H301,H306,H401,H403,H404,H405
+ignore = H101,H301,H306,H401,H403,H404,H405
show-source = True
exclude = .venv,.tox,dist,doc,*egg