We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async def _incr_decr( self, conn: Connection, command: bytes, key: bytes, delta: int ) -> Optional[int]: cmd = b"%b %b %a\r\n" % (command, key, delta) resp = await self._execute_simple_command(conn, cmd) if not resp.isdigit() or resp == const.NOT_FOUND: raise ClientException( 'Memcached {} command failed'.format(str(command)), resp) return int(resp) if resp.isdigit() else None
This line return int(resp) if resp.isdigit() else None never returns None because an exception is raised first if it's not digits.
return int(resp) if resp.isdigit() else None
Also from the docstring of incr/decr, resp == const.NOT_FOUND should return None but here it raises ClientException.
resp == const.NOT_FOUND
""" :return: ``int``, new value of the item's data, after the increment or ``None`` to indicate the item with this value was not found """
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This line
return int(resp) if resp.isdigit() else None
never returns None because an exception is raised first if it's not digits.Also from the docstring of incr/decr,
resp == const.NOT_FOUND
should return None but here it raises ClientException.The text was updated successfully, but these errors were encountered: