当这个被 python 关闭时,我试图在 memcached 中捕获一个错误:
import memcache
import socket
mc = memcache.Client(['127.0.0.1:11211'], debug=1)
try:
print mc.get('gfdsgf')
except socket.error:
print 'error'
但是我的控制台中仍然出现此错误:
MemCached: MemCache: inet:127.0.0.1:11211: connect: Connection refused. Marking dead.
None