Skip to content

Commit

Permalink
Remove super's args
Browse files Browse the repository at this point in the history
  • Loading branch information
Surgo committed Jun 27, 2020
1 parent 915e31b commit 1fefcd0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion django_elastipymemcache/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class Client(HashClient):
def get_many(self, keys, gets=False, *args, **kwargs):
# pymemcache's HashClient may returns {'key': False}
end = super(Client, self).get_many(keys, gets, *args, **kwargs)
end = super().get_many(keys, gets, *args, **kwargs)

return {key: end.get(key) for key in end if end.get(key)}

Expand Down
5 changes: 3 additions & 2 deletions django_elastipymemcache/cluster_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class WrongProtocolData(ValueError):
in telnet protocol
"""
def __init__(self, cmd, response):
super(WrongProtocolData, self).__init__(
'Unexpected response {} for command {}'.format(response, cmd))
super().__init__(
'Unexpected response {} for command {}'.format(response, cmd),
)


def get_cluster_info(
Expand Down
18 changes: 9 additions & 9 deletions django_elastipymemcache/memcached.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.core.cache import InvalidCacheBackendError
from django.core.cache.backends.memcached import BaseMemcachedCache

from . import client as pyMemcache_client
from . import client as pymemcache_client
from .cluster_utils import get_cluster_info


Expand Down Expand Up @@ -53,10 +53,10 @@ class ElastiPyMemCache(BaseMemcachedCache):
it used pyMemcache
"""
def __init__(self, server, params):
super(ElastiPyMemCache, self).__init__(
super().__init__(
server,
params,
library=pyMemcache_client,
library=pymemcache_client,
value_not_found_exception=ValueError)
if len(self._servers) > 1:
raise InvalidCacheBackendError(
Expand Down Expand Up @@ -115,24 +115,24 @@ def _cache(self):

@invalidate_cache_after_error
def get(self, *args, **kwargs):
return super(ElastiPyMemCache, self).get(*args, **kwargs)
return super().get(*args, **kwargs)

@invalidate_cache_after_error
def get_many(self, *args, **kwargs):
return super(ElastiPyMemCache, self).get_many(*args, **kwargs)
return super().get_many(*args, **kwargs)

@invalidate_cache_after_error
def set(self, *args, **kwargs):
return super(ElastiPyMemCache, self).set(*args, **kwargs)
return super().set(*args, **kwargs)

@invalidate_cache_after_error
def set_many(self, *args, **kwargs):
return super(ElastiPyMemCache, self).set_many(*args, **kwargs)
return super().set_many(*args, **kwargs)

@invalidate_cache_after_error
def delete(self, *args, **kwargs):
return super(ElastiPyMemCache, self).delete(*args, **kwargs)
return super().delete(*args, **kwargs)

@invalidate_cache_after_error
def delete_many(self, *args, **kwargs):
return super(ElastiPyMemCache, self).delete_many(*args, **kwargs)
return super().delete_many(*args, **kwargs)
3 changes: 1 addition & 2 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ def test_client_get_many(get_cluster_info):
ret = backend.get_many(['key2'])
eq_(ret, {})

with patch('django_elastipymemcache.client.Client.get_many'), \
patch('pymemcache.client.hash.HashClient._safely_run_func') as p2:
with patch('pymemcache.client.hash.HashClient._safely_run_func') as p2:
p2.return_value = {
':1:key3': 1509111630.048594
}
Expand Down

0 comments on commit 1fefcd0

Please sign in to comment.