Flake8/pep8 the code
This commit is contained in:
@@ -128,9 +128,9 @@ class Client(object):
|
||||
strings must be encoded (as UTF-8, for example) unless they consist only
|
||||
of ASCII characters that are neither whitespace nor control characters.
|
||||
|
||||
Values must have a __str__() method to convert themselves to a byte string.
|
||||
Unicode objects can be a problem since str() on a Unicode object will
|
||||
attempt to encode it as ASCII (which will fail if the value contains
|
||||
Values must have a __str__() method to convert themselves to a byte
|
||||
string. Unicode objects can be a problem since str() on a Unicode object
|
||||
will attempt to encode it as ASCII (which will fail if the value contains
|
||||
code points larger than U+127). You can fix this will a serializer or by
|
||||
just calling encode on the string (using UTF-8, for instance).
|
||||
|
||||
@@ -602,7 +602,8 @@ class Client(object):
|
||||
Args:
|
||||
delay: optional int, the number of seconds to wait before flushing,
|
||||
or zero to flush immediately (the default).
|
||||
noreply: optional bool, True to not wait for the response (the default).
|
||||
noreply: optional bool, True to not wait for the response
|
||||
(the default).
|
||||
|
||||
Returns:
|
||||
True.
|
||||
|
||||
@@ -42,6 +42,7 @@ Best Practices:
|
||||
old cluster before you switch away from FallbackClient.
|
||||
"""
|
||||
|
||||
|
||||
class FallbackClient(object):
|
||||
def __init__(self, caches):
|
||||
assert len(caches) > 0
|
||||
|
||||
@@ -46,6 +46,7 @@ def python_memcache_serializer(key, value):
|
||||
|
||||
return value, flags
|
||||
|
||||
|
||||
def python_memcache_deserializer(key, value, flags):
|
||||
if flags == 0:
|
||||
return value
|
||||
@@ -61,7 +62,7 @@ def python_memcache_deserializer(key, value, flags):
|
||||
buf = StringIO(value)
|
||||
unpickler = pickle.Unpickler(buf)
|
||||
return unpickler.load()
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logging.info('Pickle error', exc_info=True)
|
||||
return None
|
||||
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
[wheel]
|
||||
universal = true
|
||||
|
||||
[flake8]
|
||||
exclude = pymemcache/test/
|
||||
show-source = True
|
||||
|
||||
8
tox.ini
8
tox.ini
@@ -1,11 +1,17 @@
|
||||
[tox]
|
||||
envlist = py26, py27, pypy, py33, py34
|
||||
envlist = py26, py27, pypy, py33, py34, flake8
|
||||
|
||||
[testenv]
|
||||
deps = nose
|
||||
commands =
|
||||
python setup.py nosetests
|
||||
|
||||
[testenv:flake8]
|
||||
commands =
|
||||
pip install flake8
|
||||
flake8 .
|
||||
|
||||
|
||||
[testenv:docs]
|
||||
commands =
|
||||
pip install -r docs-requirements.txt
|
||||
|
||||
Reference in New Issue
Block a user