# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from functools import partial from redis import Redis def fix_return_type(func): # deliberately no functools.wraps() call here, since the function being # wrapped is a partial, which has no module def _inner(*args, **kwargs): value = func(*args, **kwargs) if value is None: value = -1 return value return _inner