Skip to content

Commit 7599993

Browse files
authored
Merge pull request #6 from ezubillaga/master
Python 3 support
2 parents da6dcb3 + 0908c50 commit 7599993

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/memcached_stats.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
class MemcachedStats:
44

55
_client = None
6-
_key_regex = re.compile(ur'ITEM (.*) \[(.*); (.*)\]')
7-
_slab_regex = re.compile(ur'STAT items:(.*):number')
8-
_stat_regex = re.compile(ur"STAT (.*) (.*)\r")
6+
_key_regex = re.compile(r'ITEM (.*) \[(.*); (.*)\]')
7+
_slab_regex = re.compile(r'STAT items:(.*):number')
8+
_stat_regex = re.compile(r"STAT (.*) (.*)\r")
99

1010
def __init__(self, host='localhost', port='11211', timeout=None):
1111
self._host = host
@@ -21,8 +21,8 @@ def client(self):
2121

2222
def command(self, cmd):
2323
' Write a command to telnet and return the response '
24-
self.client.write("%s\n" % cmd)
25-
return self.client.read_until('END')
24+
self.client.write(("%s\n" % cmd).encode('ascii'))
25+
return self.client.read_until(b'END').decode('ascii')
2626

2727
def key_details(self, sort=True, limit=100):
2828
' Return a list of tuples containing keys and details '

0 commit comments

Comments
 (0)